Skip to content
Browse files

Admin review and adjustments. Closes #91

  • Loading branch information...
1 parent 4e643d8 commit 69dc0455c9fa99ce649ed11b8adfaebb77053858 @matheo matheo committed Mar 30, 2012
View
2 src/modules/Clip/templates/clip_base_generator.tpl
@@ -3,7 +3,7 @@
<div class="z-admin-content-pagetitle">
{img modname='core' src='exec.png' set='icons/small' __title='Show code' alt=''}
<h3>{$pubtype.title} &raquo; {gt text='Template code'}</h3>
- {clip_adminmenu tid=$pubtype.tid code=$code}
+ {clip_adminmenu code=$code}
</div>
{insert name='getstatusmsg'}
View
2 src/modules/Clip/templates/clip_base_history.tpl
@@ -1,7 +1,7 @@
<h3>{gt text='History'}</h3>
-{clip_adminmenu tid=$pubtype.tid}
+{clip_adminmenu}
<table class="z-admintable">
<thead>
View
2 src/modules/Clip/templates/clip_base_pubfields.tpl
@@ -9,7 +9,7 @@
<div class="z-admin-content-pagetitle">
{img modname='core' src='db_update.png' set='icons/small' alt=''}
<h3>{$pubtype.title} &raquo; {gt text='Manage Publication fields'}</h3>
- {clip_adminmenu tid=$tid field=$field.id}
+ {clip_adminmenu field=$field.id}
</div>
{insert name='getstatusmsg'}
View
2 src/modules/Clip/templates/clip_base_publist.tpl
@@ -1,7 +1,7 @@
<h3>{gt text='Publications list'}</h3>
-{clip_adminmenu tid=$pubtype.tid}
+{clip_adminmenu}
{pager display='page' posvar='page' rowcount=$pager.numitems limit=$pager.itemsperpage maxpages=9 owner='Clip' template='pager_default.tpl' processUrls=false}
View
2 src/modules/Clip/templates/clip_base_pubtype.tpl
@@ -9,7 +9,7 @@
{img modname='core' src='db.png' set='icons/small' alt=''}
{if isset($pubtype.tid)}
<h3>{$pubtype.title} &raquo; {gt text='Edit publication type'}</h3>
- {clip_adminmenu tid=$pubtype.tid}
+ {clip_adminmenu}
{else}
<h3>{gt text='Create publication type'}</h3>
{/if}
View
4 src/modules/Clip/templates/clip_base_pubtypeinfo.tpl
@@ -2,7 +2,7 @@
<div class="z-admin-content-pagetitle">
{img modname='core' src='folder_documents.png' set='icons/small' __title='Publication type information' alt=''}
<h3>{$pubtype.title}</h3>
- {clip_adminmenu tid=$pubtype.tid}
+ {clip_adminmenu}
</div>
{insert name='getstatusmsg'}
@@ -83,7 +83,7 @@
<div id="p{$pubtype.tid}code" class="clip-infotab">
<ul>
<li>
- <a href="{clip_url func='generator' code='form'}">
+ <a href="{clip_url func='generator' code='edit'}">
{gt text='Form'}
</a>
<p>
View
6 src/modules/Clip/templates/clip_base_relations.tpl
@@ -3,7 +3,7 @@
{icon type='hook' size='small'}
{if $tid}
<h3>{$pubtypes[$tid].title} &raquo; {gt text='Relations'}</h3>
- {clip_adminmenu tid=$tid}
+ {clip_adminmenu}
{else}
<h3>{gt text='Manage Relations'}</h3>
{/if}
@@ -69,7 +69,7 @@
{/if}
&nbsp;
<br />
- <span class="z-sub">$pubdata.{$item.alias1|safetext}</span>
+ <span class="z-sub" title="{$item.descr1|safetext}">{$item.title1|safetext} | <code>$pubdata.{$item.alias1|safetext}</code></span>
&nbsp;&nbsp;
</span>
<span class="z-itemcell z-w40">
@@ -79,7 +79,7 @@
{gt text='has Many <strong>%s</strong>' tag1=$pubtypes[$item.tid2].title|safetext}
{/if}
<br />&nbsp;
- <span class="z-sub">$pubdata.{$item.alias2|safetext}</span>
+ <span class="z-sub" title="{$item.descr2|safetext}"><code>$pubdata.{$item.alias2|safetext}</code> | {$item.title2|safetext}</span>
</span>
<span class="z-itemcell z-w10">
<a href="{clip_url func='relations' tid=$tid id=$item.id withtid1=$filter.withtid1 op=$filter.op withtid2=$filter.withtid2 fragment='relform'}">
View
14 src/modules/Clip/templates/plugins/function.clip_adminmenu.php
@@ -13,11 +13,11 @@
* Builds and displays the admin submenu.
*
* Available parameters:
- * - tid (integer) Publication type ID.
+ * - tid (integer) Publication type ID (optional).
*
* Example:
*
- * <samp>{clip_adminmenu tid=$pubtype.tid}</samp>
+ * <samp>{clip_adminmenu}</samp>
*
* @param array $params All parameters passed to this plugin from the template.
* @param Zikula_View $view Reference to the {@link Zikula_View} object.
@@ -28,13 +28,13 @@ function smarty_function_clip_adminmenu($params, Zikula_View &$view)
{
include_once('modules/Clip/templates/plugins/function.clip_url.php');
- $tid = (int)$params['tid'];
+ $pubtype = $view->getTplVar('pubtype');
- if (!$tid) {
- return LogUtil::registerError($view->__f('%1$s: Invalid publication type ID passed [%2$s].', array('{clip_adminmenu}', DataUtil::formatForDisplay($tid))));
- }
+ $tid = isset($params['tid']) ? (int)$params['tid'] : ($pubtype ? $pubtype['tid'] : $view->getTplVar('tid'));
- $pubtype = Clip_Util::getPubType($tid);
+ if (!$tid || !Clip_Util::validateTid($tid)) {
+ return;
+ }
// build the output
$args = array('func' => 'pubtypeinfo', 'args' => array('tid' => $tid));

0 comments on commit 69dc045

Please sign in to comment.
Something went wrong with that request. Please try again.