diff options
| author | Lester Caine <lester@lsces.co.uk> | 2008-07-29 18:03:36 +0000 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2008-07-29 18:03:36 +0000 |
| commit | cbe1ba461faf9d6b6e343cc7b7ddf9633d2a711f (patch) | |
| tree | 3759815f4e7574b0d6eff1c7c8aaa7c8df803f2c /list_content.php | |
| parent | 88e94c04269b08ca069a7b50c506193a1eae7c33 (diff) | |
| download | liberty-cbe1ba461faf9d6b6e343cc7b7ddf9633d2a711f.tar.gz liberty-cbe1ba461faf9d6b6e343cc7b7ddf9633d2a711f.tar.bz2 liberty-cbe1ba461faf9d6b6e343cc7b7ddf9633d2a711f.zip | |
Bring getContentList into line with getList and drop the 'data' return.
listHash passed to getContentList is updated like getList, so those areas that need a private copy should create their own Hash.
Framework for hasDeletePermission added to LibertyContent.
Diffstat (limited to 'list_content.php')
| -rw-r--r-- | list_content.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/list_content.php b/list_content.php index 59d564e..07c8fc4 100644 --- a/list_content.php +++ b/list_content.php @@ -3,7 +3,7 @@ * list_content * * @author spider <spider@steelsun.com> - * @version $Revision: 1.27 $ + * @version $Revision: 1.28 $ * @package liberty * @subpackage functions */ @@ -39,10 +39,12 @@ include_once( LIBERTY_PKG_PATH.'get_content_list_inc.php' ); $gBitSmarty->assign( 'contentSelect', $contentSelect ); $gBitSmarty->assign( 'contentTypes', $contentTypes ); -$gBitSmarty->assign( 'contentList', $contentList['data'] ); +$gBitSmarty->assign( 'contentList', $contentList ); $contentList['listInfo']['ihash']['content_type_guid'] = $contentSelect[0]; $contentList['listInfo']['ihash']['user_id'] = @BitBase::verifyId( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : NULL; -$contentList['listInfo']['ihash']['find_objects'] = $contentList['listInfo']['find']; +if ( isset( $contentList['listInfo']['find'] ) ) { + $contentList['listInfo']['ihash']['find_objects'] = $contentList['listInfo']['find']; +} $gBitSmarty->assign( 'listInfo', $contentList['listInfo'] ); $gBitSmarty->assign( 'content_type_guids', ( isset( $_REQUEST['content_type_guid'] ) ? $_REQUEST['content_type_guid'] : NULL )); @@ -55,7 +57,7 @@ if( !empty( $_REQUEST['ajax_xml'] )) { if( !empty( $_REQUEST['output'] )) { switch( $_REQUEST['output'] ) { case 'json': - $gBitSmarty->assign_by_ref( 'listcontent', $contentList['data'] ); + $gBitSmarty->assign_by_ref( 'listcontent', $contentList ); header( 'Content-type:application/json' ); $gBitSmarty->display( 'bitpackage:liberty/list_content_json.tpl' ); break; @@ -67,8 +69,8 @@ if( !empty( $_REQUEST['output'] )) { * a package dependency somewhere is likely an issue */ require_once( UTIL_PKG_PATH.'javascript/libs/suggest/suggest_lib.php' ); - foreach( array_keys( $contentList['data'] ) as $row ) { - $xmlList[$contentList['data'][$row]['content_id']] = $contentList['data'][$row]['title']; + foreach( array_keys( $contentList ) as $row ) { + $xmlList[$contentList[$row]['content_id']] = $contentList[$row]['title']; } $xml = SuggestLib::exportXml( $xmlList, $_REQUEST['id'] ); header( "Content-Type: text/xml\n\n" ); |
