diff options
| -rw-r--r-- | Pigeonholes.php | 14 | ||||
| -rw-r--r-- | assign_non_members.php | 8 | ||||
| -rw-r--r-- | edit_pigeonholes.php | 12 | ||||
| -rw-r--r-- | list.php | 32 | ||||
| -rw-r--r-- | templates/edit_pigeonholes.tpl | 1 | ||||
| -rw-r--r-- | templates/list.tpl | 62 | ||||
| -rw-r--r-- | templates/view_structure_inc.tpl | 2 | ||||
| -rw-r--r-- | view.php | 12 |
8 files changed, 61 insertions, 82 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php index 5f10ef2..bd6779a 100644 --- a/Pigeonholes.php +++ b/Pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.15 2006/01/14 19:55:17 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.16 2006/01/17 13:40:49 squareing Exp $ * * +----------------------------------------------------------------------+ * | Copyright ( c ) 2004, bitweaver.org @@ -17,7 +17,7 @@ * Pigeonholes class * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.15 $ + * @version $Revision: 1.16 $ * @package pigeonholes */ @@ -330,12 +330,13 @@ class Pigeonholes extends LibertyAttachable { * @return array of pigeonholes in 'data' and count of pigeonholes in 'cant' * @access public **/ - function getList( $pListHash = NULL ) { + function getList( &$pListHash ) { global $gBitSystem; LibertyContent::prepGetList( $pListHash ); $bindVars = array(); $where = ''; + $ret = array(); if( !empty( $pListHash['find'] ) ) { $where .= " WHERE UPPER( tc.`title` ) LIKE ? "; @@ -389,11 +390,9 @@ class Pigeonholes extends LibertyAttachable { if( $gBitSystem->getPreference( 'pigeonholes_list_style' ) == 'table' ) { $this->alphabetiseMembers( $aux['members'] ); } - } else { -// $aux['members_count'] = $this->mDb->getOne( "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."bit_pigeonhole_members` WHERE `parent_id`=?", array( $aux['content_id'] ) ); } - $ret['data'][] = $aux; + $ret[] = $aux; $result->MoveNext(); } @@ -401,7 +400,8 @@ class Pigeonholes extends LibertyAttachable { FROM `".BIT_DB_PREFIX."bit_pigeonholes` bp INNER JOIN `".BIT_DB_PREFIX."tiki_structures` ts ON ( ts.`structure_id` = bp.`structure_id` ) WHERE ts.`structure_id`=ts.`root_structure_id`"; - $ret['cant'] = $this->mDb->getOne( $query ); + $pListHash['cant'] = $this->mDb->getOne( $query ); + LibertyContent::postGetList( $pListHash ); return $ret; } diff --git a/assign_non_members.php b/assign_non_members.php index 947dca1..11b1f82 100644 --- a/assign_non_members.php +++ b/assign_non_members.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/Attic/assign_non_members.php,v 1.4 2006/01/14 19:55:18 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/Attic/assign_non_members.php,v 1.5 2006/01/17 13:40:49 squareing Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: assign_non_members.php,v 1.4 2006/01/14 19:55:18 squareing Exp $ + * $Id: assign_non_members.php,v 1.5 2006/01/17 13:40:49 squareing Exp $ * @package pigeonholes * @subpackage functions */ @@ -75,7 +75,7 @@ if( !empty( $_REQUEST['insert_content'] ) && isset( $_REQUEST['pigeonhole'] ) ) $pigeonRootData = $gPigeonholes->getList( array( 'only_get_root' => TRUE ) ); $pigeonRoots[0] = 'All'; -foreach( $pigeonRootData['data'] as $root ) { +foreach( $pigeonRootData as $root ) { $pigeonRoots[$root['root_structure_id']] = $root['title']; } $gBitSmarty->assign( 'pigeonRoots', !empty( $pigeonRoots ) ? $pigeonRoots : NULL ); @@ -85,7 +85,7 @@ $listHash = array( 'force_extras' => TRUE ); $pigeonList = $gPigeonholes->getList( $listHash ); -$gBitSmarty->assign( 'pigeonList', !empty( $pigeonList['data'] ) ? $pigeonList['data'] : NULL ); +$gBitSmarty->assign( 'pigeonList', $pigeonList ); $gBitSmarty->assign( 'nonMembers', $nonMembers ); $gBitSmarty->assign( 'contentCount', count( $nonMembers ) ); diff --git a/edit_pigeonholes.php b/edit_pigeonholes.php index eda6aa1..b709c05 100644 --- a/edit_pigeonholes.php +++ b/edit_pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_pigeonholes.php,v 1.5 2006/01/14 19:55:18 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_pigeonholes.php,v 1.6 2006/01/17 13:40:49 squareing Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: edit_pigeonholes.php,v 1.5 2006/01/14 19:55:18 squareing Exp $ + * $Id: edit_pigeonholes.php,v 1.6 2006/01/17 13:40:49 squareing Exp $ * @package pigeonholes * @subpackage functions */ @@ -25,11 +25,6 @@ include_once( LIBERTY_PKG_PATH.'LibertyStructure.php' ); include_once( THEMES_PKG_PATH.'theme_control_lib.php' ); include_once( PIGEONHOLES_PKG_PATH.'lookup_pigeonholes_inc.php' ); -if( !empty( $_REQUEST['pigeonhole_store_and_create'] ) ) { - $_REQUEST['pigeonhole_store'] = TRUE; - $_REQUEST['action'] = 'create'; -} - // include edit structure file only when structure_id is known if( !empty( $_REQUEST["structure_id"] ) && ( empty( $_REQUEST['action'] ) || $_REQUEST['action'] != 'remove' ) ) { $verifyStructurePermission = 'bit_p_edit_pigeonholes'; @@ -142,8 +137,7 @@ $gBitSmarty->assign( 'contentTypes', $contentTypes ); $listHash['root_structure_id'] = $gPigeonholes->mInfo['root_structure_id']; $listHash['force_extras'] = TRUE; $pigeonList = $gPigeonholes->getList( $listHash ); -$gBitSmarty->assign( 'pigeonList', empty( $pigeonList['data'] ) ? NULL : $pigeonList['data'] ); - +$gBitSmarty->assign( 'pigeonList', $pigeonList ); $gBitSmarty->assign( 'feedback', !empty( $feedback ) ? $feedback : NULL ); // Get list of available styles @@ -3,7 +3,7 @@ * $Header * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @package pigeonholes * @subpackage functions */ @@ -18,35 +18,21 @@ $gBitSystem->verifyPermission( 'bit_p_view_pigeonholes' ); include_once( PIGEONHOLES_PKG_PATH.'lookup_pigeonholes_inc.php' ); -// some specific offsets and pagination settings -if( !empty( $_REQUEST['sort_mode'] ) ) { - $gBitSmarty->assign( 'sort_mode', $_REQUEST['sort_mode'] ); -} - -$gBitSmarty->assign( 'curPage', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 ); -$listHash = array( - 'sort_mode' => !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : 'title_asc', - 'max_rows' => $gBitSystem->mPrefs['maxRecords'], - 'offset' => ( $page - 1 ) * $gBitSystem->mPrefs['maxRecords'], - 'find' => !empty( $_REQUEST['find'] ) ? $_REQUEST['find'] : NULL, - 'load_only_root' => TRUE, -); - +$listHash = &$_REQUEST; +$listHash['load_only_root'] = TRUE; +$listHash['sort_mode'] = !empty( $listHash['sort_mode'] ) ? $listHash['sort_mode'] : 'title_asc'; $pigeonList = $gPigeonholes->getList( $listHash ); // set up structure related stuff -if( !empty( $pigeonList['data'] ) ) { - foreach( $pigeonList['data'] as $key => $pigeonhole ) { +if( !empty( $pigeonList ) ) { + foreach( $pigeonList as $key => $pigeonhole ) { $gStructure = new LibertyStructure( $pigeonhole['root_structure_id'] ); $gStructure->load(); - $pigeonList['data'][$key]['subtree'] = $gStructure->getSubTree( $gStructure->mStructureId ); + $pigeonList[$key]['subtree'] = $gStructure->getSubTree( $gStructure->mStructureId ); } - $gBitSmarty->assign( 'pigeonList', $pigeonList['data'] ); + $gBitSmarty->assign( 'pigeonList', $pigeonList ); } - -//$gBitSmarty->assign_by_ref('offset', $offset); -$gBitSmarty->assign( 'pigeonCount', $pigeonList['cant'] ); -$gBitSmarty->assign( 'numPages', ceil( $pigeonList['cant'] / $gBitSystem->mPrefs['maxRecords'] ) ); +$gBitSmarty->assign( 'listInfo', $listHash['control'] ); $gBitSystem->display( 'bitpackage:pigeonholes/list.tpl', tra( 'List Pigeonholes' ) ); ?> diff --git a/templates/edit_pigeonholes.tpl b/templates/edit_pigeonholes.tpl index df30670..854961d 100644 --- a/templates/edit_pigeonholes.tpl +++ b/templates/edit_pigeonholes.tpl @@ -68,7 +68,6 @@ <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} diff --git a/templates/list.tpl b/templates/list.tpl index dbb2d0c..f4e18ae 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -1,7 +1,7 @@ {strip} <div class="listing pigeonholes"> <div class="header"> - <h1>{tr}Categories Listing{/tr}</h1> + <h1>{tr}Categories Listing{/tr} <span class="total">[ {$listInfo.cant} ]</span></h1> </div> {* user sort related assigning *} @@ -15,40 +15,36 @@ <div class="body"> {minifind} + <div class="navbar"> + <ul> + <li>{biticon ipackage=liberty iname=sort iexplain=sort}</li> + <li>{smartlink ititle="Title" isort=title page=$page idefault=1}</li> + <li>{smartlink ititle="Description" isort=data page=$page}</li> + </ul> + </div> + <div class="clear"></div> - <table class="data"> - <caption>{tr}Available Categories{/tr} <span class="total">[ {$pigeonCount} ]</span></caption> - <tr> - <th style="width:45%;">{smartlink ititle="Title" isort=title page=$page idefault=1} / {smartlink ititle="Description" isort=data page=$page}</th> - <th style="width:42%;">{tr}Categories{/tr}</th> - {if $gBitUser->hasPermission( 'bit_p_edit_pigeonholes' )} - <th style="width:9%;">{tr}Actions{/tr}</th> - {/if} - </tr> - - {foreach from=$pigeonList item=item} - <tr class="{cycle values='odd,even'}"> - <td> - <h2>{$item.display_link}</h2> - {$item.data} - </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} - {smartlink ititle="Edit Category" ifile="edit_pigeonholes.php" ibiticon="liberty/edit" structure_id=`$item.structure_id`} - {smartlink ititle="Change Structure" ifile="edit_structure.php" ibiticon="pigeonholes/organise" structure_id=`$item.structure_id`} - {smartlink ititle="Remove Category" ifile="edit_pigeonholes.php" ibiticon="liberty/delete" action="remove" structure_id=`$item.structure_id`} - </td> - {/if} - </tr> - {foreachelse} - <tr class="norecords"> - <td colspan="5">{tr}No Records Found{/tr}</td> - </tr> - {/foreach} - </table> + <hr /> + {foreach from=$pigeonList item=item} + {if $gBitUser->hasPermission( 'bit_p_edit_pigeonholes' )} + <div class="floaticon"> + {smartlink ititle="Insert new Category" ifile="edit_pigeonholes.php" ibiticon="liberty/new" structure_id=`$item.structure_id` action=create} + {smartlink ititle="Edit Category" ifile="edit_pigeonholes.php" ibiticon="liberty/edit" structure_id=`$item.structure_id`} + {smartlink ititle="Change Structure" ifile="edit_structure.php" ibiticon="pigeonholes/organise" structure_id=`$item.structure_id`} + {smartlink ititle="Remove Category" ifile="edit_pigeonholes.php" ibiticon="liberty/delete" action="remove" structure_id=`$item.structure_id`} + </div> + {/if} + <h2>{$item.display_link}</h2> + {$item.data} + {include file="bitpackage:pigeonholes/view_structure_inc.tpl" no_edit=TRUE subtree=$item.subtree no_details=true} + <hr /> + {foreachelse} + <div class="norecords"> + <td colspan="5">{tr}No Records Found{/tr}</td> + </div> + {/foreach} + {pagination} {libertypagination numPages=$numPages page=$curPage sort_mode=$sort_mode content_type=$contentSelect user_id=$user_id} </div><!-- end .body --> </div><!-- end .liberty --> diff --git a/templates/view_structure_inc.tpl b/templates/view_structure_inc.tpl index e8b3a88..1b4bf26 100644 --- a/templates/view_structure_inc.tpl +++ b/templates/view_structure_inc.tpl @@ -1,5 +1,5 @@ {strip} -<ul class="toc"> +<ul> <li> {section name=ix loop=$subtree} {assign var=structId value=$subtree[ix].structure_id} @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.2 2006/01/14 19:55:19 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.3 2006/01/17 13:40:49 squareing Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: view.php,v 1.2 2006/01/14 19:55:19 squareing Exp $ + * $Id: view.php,v 1.3 2006/01/17 13:40:49 squareing Exp $ * @package pigeonholes * @subpackage functions */ @@ -37,8 +37,12 @@ $gBitSmarty->assign_by_ref( 'gStructure', $gStructure ); $gBitSmarty->assign( 'structureInfo', $gStructure->mInfo ); $gBitSmarty->assign( 'subtree', $gStructure->getSubTree( $gStructure->mStructureId ) ); -$listHash = array( 'root_structure_id' => $gPigeonholes->mInfo['root_structure_id'], 'structure_id' => $gPigeonholes->mInfo['structure_id'], 'load_extras' => TRUE ); -$pigeonList = $gPigeonholes->getList( $listHash ); +$pigeonList = array( + 'root_structure_id' => $gPigeonholes->mInfo['root_structure_id'], + 'structure_id' => $gPigeonholes->mInfo['structure_id'], + 'load_extras' => TRUE +); +$gPigeonholes->getList( $pigeonList ); $gBitSmarty->assign( 'pigeonList', $pigeonList['data'] ); $gBitSmarty->assign( 'list_style', $gBitSystem->getPreference( 'pigeonholes_list_style', 'dynamic' ) ); |
