summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-01-14 19:55:19 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-01-14 19:55:19 +0000
commit154080e959440ca9168a56196cf786d1a7405cc5 (patch)
tree1db481cca7fd65ed74d277e25583ba52e4402cf5 /templates
parent9a238f69969e9c3c33f72dd35335dffc8f52f774 (diff)
downloadpigeonholes-154080e959440ca9168a56196cf786d1a7405cc5.tar.gz
pigeonholes-154080e959440ca9168a56196cf786d1a7405cc5.tar.bz2
pigeonholes-154080e959440ca9168a56196cf786d1a7405cc5.zip
merge recent changes into HEAD
Diffstat (limited to 'templates')
-rw-r--r--templates/admin_pigeonholes.tpl10
-rw-r--r--templates/edit_pigeonholes.tpl72
-rw-r--r--templates/edit_pigeonholes_inc.tpl63
-rw-r--r--templates/edit_structure.tpl2
-rw-r--r--templates/list.tpl2
-rw-r--r--templates/section_inc.tpl149
-rw-r--r--templates/view_structure_inc.tpl13
7 files changed, 227 insertions, 84 deletions
diff --git a/templates/admin_pigeonholes.tpl b/templates/admin_pigeonholes.tpl
index b80dfcb..a871232 100644
--- a/templates/admin_pigeonholes.tpl
+++ b/templates/admin_pigeonholes.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_pigeonholes/templates/admin_pigeonholes.tpl,v 1.1 2005/08/21 16:22:47 squareing Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_pigeonholes/templates/admin_pigeonholes.tpl,v 1.2 2006/01/14 19:55:19 squareing Exp $ *}
{strip}
{form}
{legend legend="Category Settings"}
@@ -14,6 +14,14 @@
{/foreach}
<div class="row">
+ {formlabel label="List style" for="pigeonholes_list_style"}
+ {forminput}
+ {html_options name="pigeonholes_list_style" options=$listStyles values=$listStyles selected=`$gBitSystemPrefs.pigeonholes_list_style` id=pigeonholes_list_style}
+ {formhelp note="Select the display method. Table listing is better suited for large categories.<br />Custom sorting only works with the dynamic list method."}
+ {/forminput}
+ </div>
+
+ <div class="row">
{formlabel label="Number of Members" for="member_number"}
{forminput}
{html_options name="limit_member_number" options=$memberLimit values=$memberLimit selected=`$gBitSystemPrefs.limit_member_number` id=member_number}
diff --git a/templates/edit_pigeonholes.tpl b/templates/edit_pigeonholes.tpl
index ed2f2a2..df30670 100644
--- a/templates/edit_pigeonholes.tpl
+++ b/templates/edit_pigeonholes.tpl
@@ -7,13 +7,71 @@
<div class="body">
{formfeedback hash=$feedback}
- {if $gBitUser->hasPermission( 'bit_p_edit_pigeonholes' ) and ( $smarty.request.action eq 'create' or $smarty.request.action eq 'edit' or !$gPigeonholes->mContentId )}
- {include file="bitpackage:pigeonholes/edit_pigeonholes_inc.tpl"}
- {elseif $gBitUser->hasPermission( 'bit_p_edit_pigeonholes' )}
- {smartlink ititle="Insert new Category" ifile="edit_pigeonholes.php" structure_id=`$gPigeonholes->mStructureId` action=create}
- <br />
- {/if}
+ {form legend="Create / Edit Category"}
+ {if $gPigeonholes->mStructureId}
+ <input type="hidden" name="structure_id" value="{$gPigeonholes->mStructureId}" />
+ <input type="hidden" name="content_id" value="{$pigeonInfo.content_id}" />
+ <input type="hidden" name="action" value="{$smarty.request.action}" />
- {include file="bitpackage:pigeonholes/view_structure_inc.tpl" edit=true}
+ <div class="row">
+ {formlabel label="Parent" for="pigeonhole-parent"}
+ {forminput}
+ {* we need to disable dropdown when editing since it might confus users when nothing happens *}
+ {if $pigeonInfo.content_id}
+ {html_options id="pigeonhole-parent" name="pigeonhole[parent_id]" values=$pigeonStructure options=$pigeonStructure selected=$pigeonInfo.parent_id disabled=disabled}
+ {else}
+ {html_options id="pigeonhole-parent" name="pigeonhole[parent_id]" values=$pigeonStructure options=$pigeonStructure selected=$pigeonInfo.parent_id}
+ {/if}
+ {formhelp note="Pick where you would like to create a new sub-category. To change the hierarchy of the categories, please visit the change structure page."}
+ {/forminput}
+ </div>
+ {/if}
+
+ <div class="row">
+ {formlabel label="Title" for="pigeonhole-title"}
+ {forminput}
+ <input type="text" size="50" id="pigeonhole-title" name="pigeonhole[title]" value="{$pigeonInfo.title}" />
+ {/forminput}
+ </div>
+
+ <div class="row">
+ {formlabel label="Description" for="pigeonhole-desc"}
+ {forminput}
+ <textarea id="pigeonhole-desc" name="pigeonhole[edit]" rows="3" cols="50">{$pigeonInfo.data|escape}</textarea>
+ {formhelp note="A description of the category. This will be visible when users view this particular category."}
+ {/forminput}
+ </div>
+
+ <div class="row">
+ {formlabel label="Theme" for="pigeonhole-style"}
+ {forminput}
+ {html_options id="pigeonhole-style" name="pigeonhole[settings][style]" output=$styles values=$styles selected=$pigeonInfo.settings.style}
+ {formhelp note="This theme will be applied when viewing any page belonging to this category."}
+ {/forminput}
+ </div>
+
+ <div class="row">
+ {formlabel label="Content" for="pigeonhole-content"}
+ {forminput}
+ {html_options values=$contentTypes options=$contentTypes name=content_type_guid selected=$contentSelect}
+ {/forminput}
+
+ {forminput}
+ {html_options multiple="multiple" size="12" name="pigeonhole[members][]" id="pigeonhole-content" values=$contentList options=$contentList selected=$pigeonInfo.selected_members}
+ {/forminput}
+
+ {forminput}
+ <input type="text" size="30" name="find_objects" value="{$smarty.request.find_objects}" />
+ <input type="submit" value="{tr}Apply filter{/tr}" name="search_objects" />
+ {/forminput}
+ </div>
+
+ <div class="row submit">
+ <input type="submit" name="pigeonhole_store" value="{tr}Save Category{/tr}" />
+ <input type="submit" name="pigeonhole_store_and_create" value="{tr}Save and Insert a new Category{/tr}" />
+ </div>
+ {/form}
+
+ {include file="bitpackage:pigeonholes/view_structure_inc.tpl"}
</div><!-- end .body -->
</div><!-- end .edit -->
diff --git a/templates/edit_pigeonholes_inc.tpl b/templates/edit_pigeonholes_inc.tpl
deleted file mode 100644
index c378925..0000000
--- a/templates/edit_pigeonholes_inc.tpl
+++ /dev/null
@@ -1,63 +0,0 @@
-{form legend="Create / Edit Category"}
- {if $gPigeonholes->mStructureId}
- <input type="hidden" name="structure_id" value="{$gPigeonholes->mStructureId}" />
- <input type="hidden" name="content_id" value="{$pigeonInfo.content_id}" />
- <input type="hidden" name="action" value="{$smarty.request.action}" />
-
- <div class="row">
- {formlabel label="Parent" for="pigeonhole-parent"}
- {forminput}
- {* we need to disable dropdown when editing since it might confus users when nothing happens *}
- {if $pigeonInfo.content_id}
- {html_options id="pigeonhole-parent" name="pigeonhole[parent_id]" values=$pigeonStructure options=$pigeonStructure selected=$pigeonInfo.parent_id disabled=disabled}
- {else}
- {html_options id="pigeonhole-parent" name="pigeonhole[parent_id]" values=$pigeonStructure options=$pigeonStructure selected=$pigeonInfo.parent_id}
- {/if}
- {formhelp note="Pick where you would like to create a new sub-category. To change the hierarchy of the categories, please visit the change structure page."}
- {/forminput}
- </div>
- {/if}
-
- <div class="row">
- {formlabel label="Title" for="pigeonhole-title"}
- {forminput}
- <input type="text" size="50" id="pigeonhole-title" name="pigeonhole[title]" value="{$pigeonInfo.title}" />
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="Description" for="pigeonhole-desc"}
- {forminput}
- <textarea id="pigeonhole-desc" name="pigeonhole[edit]" rows="3" cols="50">{$pigeonInfo.data|escape}</textarea>
- {formhelp note="A description of the category. This will be visible when users view this particular category."}
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="Theme" for="pigeonhole-style"}
- {forminput}
- {html_options id="pigeonhole-style" name="pigeonhole[settings][style]" output=$styles values=$styles selected=$pigeonInfo.settings.style}
- {formhelp note="This theme will be applied when viewing any page belonging to this category."}
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="Content" for="pigeonhole-content"}
- {forminput}
- {html_options values=$contentTypes options=$contentTypes name=content_type_guid selected=$contentSelect}
- {/forminput}
-
- {forminput}
- {html_options multiple="multiple" size="12" name="pigeonhole[members][]" id="pigeonhole-content" values=$contentList options=$contentList selected=$pigeonInfo.selected_members}
- {/forminput}
-
- {forminput}
- <input type="text" size="30" name="find_objects" value="{$smarty.request.find_objects}" />
- <input type="submit" value="{tr}Apply filter{/tr}" name="search_objects" />
- {/forminput}
- </div>
-
- <div class="row submit">
- <input type="submit" name="pigeonhole_store" value="{tr}Save Category{/tr}" />
- </div>
-{/form}
diff --git a/templates/edit_structure.tpl b/templates/edit_structure.tpl
index 196637f..50cf64c 100644
--- a/templates/edit_structure.tpl
+++ b/templates/edit_structure.tpl
@@ -6,6 +6,6 @@
</div>
<div class="body">
- {include file="bitpackage:liberty/edit_structure_inc.tpl" hide_extended=TRUE}
+ {include file="bitpackage:liberty/edit_structure_inc.tpl" no_delete=TRUE}
</div><!-- end .body -->
</div><!-- end .edit -->
diff --git a/templates/list.tpl b/templates/list.tpl
index 57365e3..dbb2d0c 100644
--- a/templates/list.tpl
+++ b/templates/list.tpl
@@ -32,7 +32,7 @@
<h2>{$item.display_link}</h2>
{$item.data}
</td>
- <td style="white-space:nowrap">{include file="bitpackage:pigeonholes/view_structure_inc.tpl" plain=true subtree=$item.subtree}</td>
+ <td style="white-space:nowrap">{include file="bitpackage:pigeonholes/view_structure_inc.tpl" no_edit=TRUE subtree=$item.subtree}</td>
{if $gBitUser->hasPermission( 'bit_p_edit_pigeonholes' )}
<td class="actionicon">
{smartlink ititle="Insert new Category" ifile="edit_pigeonholes.php" ibiticon="liberty/new" structure_id=`$item.structure_id` action=create}
diff --git a/templates/section_inc.tpl b/templates/section_inc.tpl
new file mode 100644
index 0000000..ba61ae1
--- /dev/null
+++ b/templates/section_inc.tpl
@@ -0,0 +1,149 @@
+{strip}
+{if $list_style == "table"}
+
+ {* ======= this display method requires "alphabetisation" ======= *}
+ <h3><a href="{$smarty.const.PIGEONHOLES_PKG_URL}view.php?structure_id={$subtree[ix].structure_id}">{$subtree[ix].title}</a></h3>
+
+ {foreach from=$pigeonList item=pigeonItem}
+ {if $pigeonItem.structure_id eq $subtree[ix].structure_id && $pigeonItem.members}
+ {$pigeonItem.data|escape}
+ <table class="data"><tr>
+ {*use a fixed number here for now, we can change this eventually with a preference*}
+ {math equation="100 / x" x=3 assign=width format="%u"}
+ {foreach from=$pigeonItem.members item=pigeonColumn}
+ <td style="vertical-align:top; width:{$width}%;">
+ {foreach from=$pigeonColumn item=members key=index}
+ <h2>{$index}</h2>
+ <ul>
+ {foreach from=$members item=member}
+ <li>
+ <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$member.content_id}">{$member.title}</a>
+ <br />
+ <small>{$member.content_type_description}</small>
+ </li>
+ {/foreach}
+ </ul>
+ {/foreach}
+ </td>
+ {/foreach}
+ </tr></table>
+ {/if}
+ {/foreach}
+
+{elseif $list_style == "dynamic"}
+
+ {* ======= crazy display for only few category memebers - only display method that allows custom sorting ======= *}
+ {if $gPigeonholes->mStructureId eq $subtree[ix].structure_id or $smarty.request.expand_all}
+ {assign var=iname value=Expanded}
+ {else}
+ {assign var=iname value=Collapsed}
+ {/if}
+
+ <div class="highlight">
+ {if $edit}
+ <div class="floaticon">
+ {smartlink ititle="Edit Category" ibiticon="liberty/edit" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=edit}
+ {smartlink ititle="Remove Category" ibiticon="liberty/delete" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=remove}
+ </div>
+ {/if}
+
+ <a href="javascript:icntoggle('sid{$subtree[ix].structure_id}');">
+ {biticon ipackage=liberty iname=$iname id=sid`$subtree[ix].structure_id`img"} {$subtree[ix].title}
+ </a> &nbsp;
+
+ <script type="text/javascript">
+ setfoldericonstate('sid{$subtree[ix].structure_id}');
+ </script>
+
+ {foreach from=$pigeonList item=pigeonItem}
+ {if $pigeonItem.structure_id eq $subtree[ix].structure_id}
+ <small> {tr}{$pigeonItem.members_count} Item(s){/tr} </small>
+ {/if}
+ {/foreach}
+
+ <noscript>
+ <div style="padding-left:18px;" class="small"><a href="{$smarty.const.PIGEONHOLES_PKG_URL}{if $edit}edit_pigeonholes{else}index{/if}.php?structure_id={$subtree[ix].structure_id}">{tr}Expand{/tr}</a></div>
+ </noscript>
+ </div>
+
+ {foreach from=$pigeonList item=pigeonItem}
+ {if $pigeonItem.structure_id eq $subtree[ix].structure_id}
+ <small>{$pigeonItem.data|escape}</small>
+
+ {if $pigeonItem.members}
+ <ul id="sid{$subtree[ix].structure_id}" style="display:{if $gPigeonholes->mStructureId eq $subtree[ix].structure_id or $smarty.request.expand_all}block{else}none{/if};" class="data">
+ {foreach from=$pigeonItem.members item=pigeonMember}
+ {if $gBitSystem->isFeatureActive( 'custom_member_sorting' )}
+ <li>
+ {if $edit && $gBitSystem->isFeatureActive( 'custom_member_sorting' )}
+ {if $pigeonMember.pos ne 1}
+ {smartlink ititle="Move item up" ibiticon="liberty/nav_up" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=move orientation=north structure_id=$pigeonItem.structure_id parent_id=$pigeonItem.content_id member_id=$pigeonMember.content_id}
+ {else}
+ {biticon ipackage="liberty" iname="spacer"}
+ {/if}
+
+ {if $pigeonMember.pos ne $pigeonItem.members_count}
+ {smartlink ititle="Move item down" ibiticon="liberty/nav_down" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=move orientation=south structure_id=$pigeonItem.structure_id parent_id=$pigeonItem.content_id member_id=$pigeonMember.content_id}
+ {else}
+ {biticon ipackage="liberty" iname="spacer"}
+ {/if}
+ {/if}
+ &nbsp; <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$pigeonMember.content_id}">{$pigeonMember.title}</a> &nbsp;
+ {if $edit}
+ {smartlink ititle="Remove Item" ibiticon="liberty/delete_small" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=demember structure_id=$pigeonItem.structure_id parent_id=$pigeonMember.content_id content_id=$pigeonItem.content_id}
+ {/if}
+ </li>
+ {else}
+ {assign var=ctg1 value=$pigeonMember.content_type_guid}
+
+ {* close off the content type <ul> *}
+ {if $ctg1 ne $ctg2 and $ctg2}
+ </ul>
+ </li>
+ {/if}
+
+ {* open the content type <ul> *}
+ {if $ctg1 ne $ctg2}
+ <li>{$gLibertySystem->mContentTypes.$ctg1.content_description}
+ <ul>
+ {/if}
+
+ <li>
+ <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$pigeonMember.content_id}">{$pigeonMember.title}</a>
+ {if $edit}
+ &nbsp; {smartlink ititle="Remove Item" ibiticon="liberty/delete_small" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=demember structure_id=$pigeonItem.structure_id parent_id=$pigeonMember.content_id content_id=$pigeonItem.content_id}
+ {/if}
+ </li>
+
+ {assign var=ctg2 value=$pigeonMember.content_type_guid}
+ {/if}
+ {/foreach}
+
+ {if !$gBitSystem->isFeatureActive( 'custom_member_sorting' )}
+ </ul>
+ </li>
+ {/if}
+ </ul>
+ {/if}
+ {/if}
+ {/foreach}
+
+{else}
+
+ {* ======= very basic display of the pigoenhole structure ======= *}
+ {if !$no_edit}
+ <div class="floaticon">
+ {smartlink ititle="Edit Category" ibiticon="liberty/edit" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=edit}
+ {smartlink ititle="Remove Category" ibiticon="liberty/delete" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=remove}
+ </div>
+ {/if}
+
+ <h3><a href="{$smarty.const.PIGEONHOLES_PKG_URL}view.php?structure_id={$subtree[ix].structure_id}">{$subtree[ix].title}</a></h3>
+
+ {foreach from=$pigeonList item=pigeonItem}
+ {if $pigeonItem.structure_id eq $subtree[ix].structure_id and $pigeonItem.members_count}
+ {tr}{$pigeonItem.members_count} Item(s){/tr}
+ {/if}
+ {/foreach}
+{/if}
+{/strip}
diff --git a/templates/view_structure_inc.tpl b/templates/view_structure_inc.tpl
index 164685a..e8b3a88 100644
--- a/templates/view_structure_inc.tpl
+++ b/templates/view_structure_inc.tpl
@@ -4,20 +4,11 @@
{section name=ix loop=$subtree}
{assign var=structId value=$subtree[ix].structure_id}
{if $subtree[ix].pos eq ''}
- {if $plain}
- {$subtree[ix].title}
- {else}
- {include file="bitpackage:pigeonholes/structure_section_inc.tpl"}
- {/if}
+ {include file="bitpackage:pigeonholes/section_inc.tpl"}
{else}
{if $subtree[ix].first}<ul>{else}</li>{/if}
{if $subtree[ix].last}</ul>{else}
- <li>
- {if $plain}
- {$subtree[ix].title}
- {else}
- {include file="bitpackage:pigeonholes/structure_section_inc.tpl"}
- {/if}
+ <li>{include file="bitpackage:pigeonholes/section_inc.tpl"}
{/if}
{/if}
{/section}