liberty
[ class tree: liberty ] [ index: liberty ] [ all elements ]

Source for file add_structure_content.php

Documentation is available at add_structure_content.php

  1. <?php
  2. /**
  3.  * @version $Header$
  4.  *
  5.  * @author   spider <spider@steelsun.com>
  6.  * @version  $Revision$
  7.  * @package  liberty
  8.  * @subpackage functions
  9.  */
  10.  
  11. /**
  12.  * required setup
  13.  */
  14. $gLiteweightScan = TRUE;
  15. require_once( '../kernel/setup_inc.php' );
  16.  
  17. if( !empty( $_REQUEST['modal'] ) ) {
  18.     $gBitSystem->mConfig['site_top_bar'] = FALSE;
  19.     $gBitSystem->mConfig['site_left_column'] = FALSE;
  20.     $gBitSystem->mConfig['site_right_column'] = FALSE;
  21.     $gBitSmarty->assign( 'popupPage', '1' );
  22. }
  23.  
  24. require_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' );
  25. require_once( LIBERTY_PKG_PATH.'edit_structure_inc.php' );
  26.  
  27. if( !empty( $_SERVER['HTTP_REFERER'] ) ) {
  28.     $urlHash = parse_url( $_SERVER['HTTP_REFERER'] );
  29.     if( $urlHash['path'] != $_SERVER['SCRIPT_NAME'] ) {
  30.         $_SESSION['structure_referer'] = $_SERVER['HTTP_REFERER'];
  31.     }
  32. }
  33.  
  34. if( $gBitThemes->isAjaxRequest() ) {
  35.     header( 'Content-Type: text/html; charset=utf-8' );
  36.     print $gBitSmarty->fetch( "bitpackage:liberty/add_structure_feedback_inc.tpl" ); 
  37.     exit;
  38. } else {
  39.  
  40.     $_REQUEST['thumbnail_size'] = 'icon';
  41.     include_once( LIBERTY_PKG_PATH.'get_content_list_inc.php' );
  42.     foreach( $contentList as $cItem ) {
  43.         $cList[$contentTypes[$cItem['content_type_guid']]][$cItem['content_id']] = $cItem['title'].' [id: '.$cItem['content_id'].']';
  44.     }
  45.     $gBitSmarty->assign_by_ref( 'contentListHash', $contentList );
  46.     $gBitSmarty->assign( 'contentList', $cList );
  47.     $gBitSmarty->assign( 'contentSelect', $contentSelect );
  48.     $gBitSmarty->assign( 'contentTypes', $contentTypes );
  49.  
  50.     $subpages = $gStructure->getStructureNodes($_REQUEST["structure_id"]);
  51.     $max = count($subpages);
  52.     $gBitSmarty->assign_by_ref('subpages', $subpages);
  53.     if ($max != 0) {
  54.         $last_child = $subpages[$max - 1];
  55.         $gBitSmarty->assign('insert_after', $last_child["structure_id"]);
  56.     }
  57.  
  58.     if( !empty( $_REQUEST['done'] ) ) {
  59.         bit_redirect( $_SESSION['structure_referer'] );
  60.     }
  61.     $gBitSystem->display( 'bitpackage:liberty/add_structure_content.tpl', "Add Content" , array( 'display_mode' => 'display' ));
  62. }

Documentation generated on Wed, 29 Jul 2015 13:55:33 +0000 by phpDocumentor 1.5.0-lsces