Commit 674ba7c3 authored by Penny Leach's avatar Penny Leach

Fixes fir Dwoo support

- Removed empty() in templates, just use if $foo instead
- Renamed badly named loadquota function
- Added list_tags function
- Fixed inline templating in javascript in authlist.tpl
parent fe93bcc3
......@@ -3,7 +3,7 @@
<div class="rbuttons">
<a class="btn btn-add" href="{$WWWROOT}artefact/blog/new/">{str section="artefact.blog" tag="addblog"}</a>
</div>
{if empty($blogs->data)}
{if !$blogs->data}
<div>{str tag=youhavenoblogs section=artefact.blog}</div>
{else}
<table id="bloglist" class="tablerenderer fullwidth">
......
{if empty($filelist)}
{if $filelist}
<p>{str tag=nofilesfound section=artefact.file}</p>
{else}
<table id="filelist" class="tablerenderer filelist">
......@@ -15,7 +15,7 @@
<tbody>
{foreach from=$filelist item=file}
{if !$publishing || !$file->permissions || $file->can_republish}{assign var=publishable value=1}{else}{assign var=publishable value=0}{/if}
<tr id="file:{$file->id}" class="r{cycle values='0,1'} directory-item{if $file->isparent} parentfolder{/if}{if $file->artefacttype == 'folder'} folder{/if}{if !empty($highlight) && $highlight == $file->id} highlight-file{/if}{if $edit == $file->id} hidden{/if}{if !$publishable && $file->artefacttype != 'folder'} disabled{/if}" {if !$publishable && $file->artefacttype != 'folder'} title="{str tag=notpublishable section=artefact.file}"{/if}>
<tr id="file:{$file->id}" class="r{cycle values='0,1'} directory-item{if $file->isparent} parentfolder{/if}{if $file->artefacttype == 'folder'} folder{/if}{if $highlight && $highlight == $file->id} highlight-file{/if}{if $edit == $file->id} hidden{/if}{if !$publishable && $file->artefacttype != 'folder'} disabled{/if}" {if !$publishable && $file->artefacttype != 'folder'} title="{str tag=notpublishable section=artefact.file}"{/if}>
<td>
{if $editable}
<div{if !$file->isparent} class="icon-drag" id="drag:{$file->id}"{/if}>
......
<p id="{$prefix}_empty_selectlist"{if !empty($selectedlist)} class="hidden"{/if}>{str tag=nofilesfound section=artefact.file}</p>
<table id="{$prefix}_selectlist" class="attachments fullwidth{if empty($selectedlist)} hidden{/if}">
<p id="{$prefix}_empty_selectlist"{if !$selectedlist} class="hidden"{/if}>{str tag=nofilesfound section=artefact.file}</p>
<table id="{$prefix}_selectlist" class="attachments fullwidth{if !$selectedlist} hidden{/if}">
<thead>
<tr>
<th></th>
......@@ -11,7 +11,7 @@
<tbody>
{foreach from=$selectedlist item=file}
{assign var=displaytitle value=$file->title|str_shorten_text:34|escape}
<tr class="r{cycle values='0,1'}{if !empty($highlight) && $highlight == $file->id} highlight-file{/if}">
<tr class="r{cycle values='0,1'}{if $highlight && $highlight == $file->id} highlight-file{/if}">
<td>
<img src="{if $file->artefacttype == 'image'}{$WWWROOT}artefact/file/download.php?file={$file->id}&size=20x20{else}{theme_url filename=images/`$file->artefacttype`.gif}{/if}">
</td>
......
{if $profileiconpath}<div class="fr"><img src="{$profileiconpath|escape}" alt=""></div>{/if}
<p>{$profileinfo.introduction|clean_html}</p>
{if $profileinfo && (count($profileinfo) != 1 || empty($profileinfo.introduction))}<ul>
{if $profileinfo && (count($profileinfo) != 1 || !$profileinfo.introduction)}<ul>
{foreach from=$profileinfo key=key item=item}
{if !in_array($key, array('introduction'))} <li><strong>{str tag=$key section=artefact.internal}:</strong> {$item}</li>
{/if}
......
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {list_tags} function plugin
*
* Type: function<br>
* Name: str<br>
* Date: June 22, 2006<br>
* Purpose: Render a list of tags
* @author Richard Mansfield <richard.mansfield@catalyst.net.nz>
* @author Penny Leach <penny@mjollnir.org>
* @version 1.0
* @param array
* @param Smarty
* @return Internationalized string
*/
function Dwoo_Plugin_list_tags(Dwoo $dwoo, $tags, $owner) {
global $USER;
if (!is_array($tags)) {
return '';
}
if ($owner != $USER->get('id')) {
return join(', ', array_map('hsc', $tags));
}
foreach ($tags as &$t) {
$t = '<a class="tag" href="' . get_config('wwwroot') . 'tags.php?tag=' . urlencode($t) . '">' . hsc(str_shorten_text($t, 50)) . '</a>';
}
return join(', ', $tags);
}
?>
......@@ -11,7 +11,7 @@
* @version 1.0
* @return Nothing
*/
function Dwoo_Function_loadquota(Dwoo $dwoo) {
function Dwoo_Plugin_loadquota(Dwoo $dwoo) {
global $USER;
if (!$USER->is_logged_in()) {
......
......@@ -3,7 +3,7 @@
{$memberform}
{$requestedform}
{$invitedform}
{if !empty($joinform)}
{if $joinform}
<h3>{str tag="requestmembershipofaninstitution"}</h3>
{$joinform}
{/if}
......
......@@ -5,7 +5,7 @@
<a href="{$WWWROOT}user/view.php?id={$user->id}"><img src="{$WWWROOT}thumb.php?type=profileiconbyid&amp;maxwidth=100&amp;maxheight=100&amp;id={$user->profileicon}" alt=""></a><br>
<a href="{$WWWROOT}user/view.php?id={$user->id}">{$user|display_name|escape}</a>
</div>
{if !empty($loginas)}
{if $loginas}
<div id="loginas"><a class="btn-loginas" href="{$WWWROOT}admin/users/changeuser.php?id={$user->id}">{$loginas}</a></div>
{/if}
</div>
......
......@@ -7,7 +7,7 @@
<body>
<div style="font-family: Arial, sans-serif; font-size: smaller; border-bottom: 1px solid #aaa; margin-bottom: 1em; padding-bottom: .5em; text-align: center;">
<div style="float: left; margin-right: 1em; height: 2em;"><a href="" onclick="history.go(-1); return false;">&laquo; {str tag="back"}</a></div>
{$htmlremovedmessage}{if !empty($params.downloadurl)} <a href="{$params.downloadurl}">{str tag="downloadoriginalversion" section="artefact.file"}</a>{/if}</div>
{$htmlremovedmessage}{if $params.downloadurl} <a href="{$params.downloadurl}">{str tag="downloadoriginalversion" section="artefact.file"}</a>{/if}</div>
<div>
{$content}
</div>
......
......@@ -108,9 +108,9 @@
function requiresConfig(authname) {
var requires_config = new Array();
{{section name=mysec3 loop=$authtypes}}
requires_config['{{$authtypes[mysec3]->name}}'] = {{$authtypes[mysec3]->requires_config}};
{{/section}}
{{foreach $authtypes authtype}}
requires_config['{{$authtype->name}}'] = {{$authtype->requires_config}};
{{/foreach}}
return requires_config[authname];
}
......@@ -169,31 +169,27 @@
IMPORTANT: do not introduce any new whitespace into the instanceList div.
*}}
<div id="instanceList">{{
section name=mysec loop=$instancelist
}}<div class="authInstance" id="instanceDiv{{$instancelist[mysec]->id}}">
<div id="instanceList">{{foreach $instancelist instance}}<div class="authInstance" id="instanceDiv{{$instance->id}}">
<label class="authLabel">
<a href="" onclick="editinstance({{$instancelist[mysec]->id}},'{{$instancelist[mysec]->authname}}'); return false;">
{{assign var=section value=$instancelist[mysec]->authname}}
{{str tag="title" section="auth.$section"}}</a>
<a href="" onclick="editinstance({{$instance->id}},'{{$instance->authname}}'); return false;">
{{str tag="title" section="auth.`$instance->authname`"}}</a>
</label>
<span class="authIcons" id="arrows{{$instancelist[mysec]->id}}">
{{ if $instancelist[mysec]->index + 1 < $instancelist[mysec]->total }}
<a href="" onclick="move_down({{$instancelist[mysec]->id}}); return false;">[&darr;]</a>
{{ /if }}
{{ if $instancelist[mysec]->index != 0 }}
<a href="" onclick="move_up({{$instancelist[mysec]->id}}); return false;">[&uarr;]</a>
{{ /if }}
<a href="" onclick="removeAuth({{$instancelist[mysec]->id}}); return false;">[x]</a>
<span class="authIcons" id="arrows{{$instance->id}}">
{{if $instance->index + 1 < $instance->total}}
<a href="" onclick="move_down({{$instance->id}}); return false;">[&darr;]</a>
{{/if}}
{{if $instance->index != 0 }}
<a href="" onclick="move_up({{$instance->id}}); return false;">[&uarr;]</a>
{{/if}}
<a href="" onclick="removeAuth({{$instance->id}}); return false;">[x]</a>
</span>
</div>{{
/section
}}</div>
</div>{{/foreach}}
</div>
<select name="dummy" id="dummySelect">
{{section name=mysec2 loop=$authtypes}}
<option value="{{$authtypes[mysec2]->name|escape}}"{{if !$authtypes[mysec2]->is_usable}} disabled="disabled"{{/if}}>{{$authtypes[mysec2]->title|escape}} - {{$authtypes[mysec2]->description|escape}}</option>
{{/section}}
{{foreach $authtypes authtype}}
<option value="{{$authtype->name|escape}}"{{if !$authtype->is_usable}} disabled="disabled"{{/if}}>{{$authtype->title|escape}} - {{$authtype->description|escape}}</option>
{{/foreach}}
</select>
<button type="button" onclick="addinstance(); return false;" name="button" value="foo">{{str tag=Add section=admin}}</button>
<input type="hidden" id="instancePriority" name="instancePriority" value="{{ $instancestring }}" />
<input type="hidden" id="instancePriority" name="instancePriority" value="{{$instancestring}}" />
<input type="hidden" id="deleteList" name="deleteList" value="" />
{if !empty($results.data)}
{if $results.data}
{foreach from=$results.cdata item=row}
<tr class="r{cycle values='0,1'}">
{foreach from=$row item=r}
......
......@@ -21,7 +21,7 @@
</td>
{/if}
<td id="main-column" class="main-column">
{insert_messages}
{dynamic}{insert_messages}{/dynamic}
<div id="main-column-container">
{if isset($PAGEHEADING)} <h1>{$PAGEHEADING}{if $PAGEHELPNAME}<span class="page-help-icon">{$PAGEHELPICON}</span>{/if}</h1>
......@@ -32,4 +32,4 @@
{/foreach}
</ul>
<div class="subpage rel">
{/if}
\ No newline at end of file
{/if}
......@@ -9,7 +9,7 @@
</div>
<div id="main-wrapper">
<div class="main-column">
{insert name="messages"}
{dynamic}{insert_messages}{/dynamic}
<div id="main-column-container">
{if isset($PAGEHEADING)} <h1>{$PAGEHEADING}{if $PAGEHELPNAME}<span class="page-help-icon">{$PAGEHELPICON}</span>{/if}</h1>
{/if}
......@@ -4,7 +4,7 @@
<td>
<div><strong><a href="{$result->url}">{$result->title|escape}</a></strong></div>
<div>{$result->description|str_shorten_html:100}</div>
{if !empty($result->tags)}
{if $result->tags}
<div>{str tag=tags}: {list_tags tags=$result->tags owner=1}</div>
{/if}
</td>
......
{if !empty($results.data)}
{if $results.data}
<h2>{str tag="Results"}</h2>
<table id="searchresults" class="tablerenderer fullwidth listing">
<thead>
{mahara_pagelinks offset=$results.offset limit=$results.limit count=$results.count url=$pagebaseurl assign=pagelinks}
{if (!empty($pagelinks))}
{if ($pagelinks)}
<tr class="search-results-pages">
<td colspan="{$ncols}">
{$pagelinks}
......@@ -12,7 +12,7 @@
{/if}
<tr>
{foreach from=$cols key=f item=c}
{if empty($c.name)}
{if !$c.name}
<th></th>
{else}
<th class="search-results-sort-column{if $f == $sortby} {$sortdir}{/if}">
......@@ -26,12 +26,12 @@
{foreach from=$results.data item=r}
<tr class="{cycle values="r0,r1"}">
{foreach from=$cols key=f item=c}
<td{if (!empty($c.class))} class="{$c.class}"{/if}>{if empty($c.template)}{$r[$f]|escape}{else}{eval var=$c.template}{/if}</td>
<td{if $c.class} class="{$c.class}"{/if}>{if !$c.template}{$r[$f]|escape}{else}{eval var=$c.template}{/if}</td>
{/foreach}
</tr>
{/foreach}
</tbody>
{if (!empty($pagelinks))}
{if $pagelinks}
<tfoot>
<tr class="search-results-pages">
<td colspan={$ncols}>
......
......@@ -4,7 +4,7 @@
{foreach from=$sbdata.menu item=item}
{if $item.path != 'groups'}
<li><a href="{$WWWROOT}{$item.url}">{$item.title}</a>
{if $item.path == 'groups/forums' && !empty($sbdata.forums)}
{if $item.path == 'groups/forums' && $sbdata.forums}
<ul>
{foreach from=$sbdata.forums item=forum}
<li><a href="{$WWWROOT}interaction/forum/view.php?id={$forum->id}">{$forum->title|escape}</a></li>
......
......@@ -34,7 +34,7 @@
<tr><th></th><th></th><th></th></tr>
</thead>
<tbody>
{if !empty($results->data)}
{if $results->data}
{$results->tablerows}
{/if}
</tbody>
......
......@@ -2,7 +2,7 @@
<div id="userview">
<div class="user-icon right">
{$institutions}
{if !empty($loginas)}
{if $loginas}
<a href="{$WWWROOT}admin/users/changeuser.php?id={$USERID}" class="btn-loginas">{$loginas}</a>
{if $USER->get('admin')}<a href="{$WWWROOT}admin/users/edit.php?id={$USERID}" class="btn-edit">{str tag=accountsettings section=admin}</a>{/if}
{/if}
......
......@@ -58,7 +58,7 @@
{elseif $accessgroup.accesstype == 'friends'}
<a href="{$WWWROOT}user/myfriends.php" id="link-myfriends">{str tag="friendslower" section="view"}</a>
{elseif $accessgroup.accesstype == 'group'}
<a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name|escape}</a>{if !empty($accessgroup.role)} ({$accessgroup.roledisplay}){/if}
<a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name|escape}</a>{if $accessgroup.role} ({$accessgroup.roledisplay}){/if}
{elseif $accessgroup.accesstype == 'user'}
<a href="{$WWWROOT}user/view.php?id={$accessgroup.id}">{$accessgroup.id|display_name|escape}</a>
{/if}{/strip}{if !$smarty.foreach.artefacts.last}, {/if}
......
......@@ -7,7 +7,7 @@
</tr>
</thead>
<tbody>
{if !empty($results)}
{if $results}
{foreach from=$results item=row}
<tr class="r{cycle values='0,1'}">
<td>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment