-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
112 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
/** | ||
* @file pages/links/LinksHandler.inc.php | ||
* | ||
* Copyright (c) 2014 Simon Fraser University Library | ||
* Copyright (c) 2003-2014 John Willinsky | ||
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. | ||
* | ||
* @class LinksHandler | ||
* @ingroup pages_links | ||
* | ||
* @brief Handle link info requests. | ||
*/ | ||
|
||
|
||
import('classes.handler.Handler'); | ||
|
||
class LinksHandler extends Handler { | ||
/** | ||
* Constructor | ||
*/ | ||
function LinksHandler() { | ||
parent::Handler(); | ||
} | ||
|
||
|
||
// | ||
// Public handler operations | ||
// | ||
/** | ||
* Display the link info page. | ||
* @param $args array | ||
* @param $request Request | ||
*/ | ||
function link($args, $request) { | ||
$templateMgr = TemplateManager::getManager($request); | ||
$this->setupTemplate($request); | ||
|
||
$path = $args[0]; | ||
if ($path != '') { | ||
$context = $request->getContext(); | ||
$footerCategoryDao = DAORegistry::getDAO('FooterCategoryDAO'); | ||
$category = $footerCategoryDao->getByPath($path, $context->getId()); | ||
if ($category) { | ||
$templateMgr->assign('category', $category); | ||
$footerLinkDao = DAORegistry::getDAO('FooterLinkDAO'); | ||
$links = $footerLinkDao->getByCategoryId($category->getId(), $context->getId()); | ||
$templateMgr->assign('links', $links->toArray()); | ||
return $templateMgr->display('links/link.tpl'); | ||
} | ||
} | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* @defgroup pages_links Link page | ||
*/ | ||
|
||
/** | ||
* @file pages/links/index.php | ||
* | ||
* Copyright (c) 2014 Simon Fraser University Library | ||
* Copyright (c) 2003-2014 John Willinsky | ||
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. | ||
* | ||
* @ingroup pages_links | ||
* @brief Handle site link page requests. | ||
* | ||
*/ | ||
|
||
|
||
switch ($op) { | ||
case 'link': | ||
define('HANDLER_CLASS', 'LinksHandler'); | ||
import('lib.pkp.pages.links.LinksHandler'); | ||
break; | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{** | ||
* templates/links/link.tpl | ||
* | ||
* Copyright (c) 2014 Simon Fraser University Library | ||
* Copyright (c) 2000-2014 John Willinsky | ||
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. | ||
* | ||
* Display a link category and associated links. | ||
* | ||
*} | ||
{strip} | ||
{assign var="pageTitleTranslated" value=$category->getLocalizedTitle()|strip_unsafe_html} | ||
{include file="common/header.tpl"} | ||
{/strip} | ||
|
||
<div id="linkInfo"> | ||
<p> | ||
{$category->getLocalizedDescription()|strip_unsafe_html} | ||
</p> | ||
<ul> | ||
{foreach from=$links item=link} | ||
<li><a href="{$link->getUrl()}">{$link->getLocalizedTitle()|strip_unsafe_html}</a></li> | ||
{/foreach} | ||
</ul> | ||
</div> | ||
|
||
{include file="common/footer.tpl"} |