Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • pApiContentAllocation
  • pApiContentAllocationArticle
  • pApiContentAllocationComplexList
  • pApiContentAllocationSelectBox
  • pApiContentAllocationTreeView
  • pApiTree

Functions

  • pica_ArticleListActions
  • pica_GetCustomTabProperties
  • pica_RegisterCustomTab
  • pica_RenderArticleAction
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the complex list class for the plugin content allocation.
  4:  *
  5:  * @package    Plugin
  6:  * @subpackage ContentAllocation
  7:  * @version    SVN Revision $Rev:$
  8:  *
  9:  * @author     Marco Jahn
 10:  * @copyright  four for business AG <www.4fb.de>
 11:  * @license    http://www.contenido.org/license/LIZENZ.txt
 12:  * @link       http://www.4fb.de
 13:  * @link       http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: plugin_include('repository', 'custom/FrontendNavigation.php');
 19: 
 20: /**
 21:  * Complex list class for content allocation
 22:  *
 23:  * @package    Plugin
 24:  * @subpackage ContentAllocation
 25:  */
 26: class pApiContentAllocationComplexList extends pApiTree {
 27: 
 28:     var $idSetter = true;
 29:     var $load = array();
 30: 
 31:     function pApiContentAllocationComplexList ($uuid) {
 32:         global $cfg;
 33:         parent::pApiTree($uuid);
 34:     }
 35: 
 36:     function _buildRenderTree ($tree) {
 37:         global $action, $frame, $area, $sess, $idart;
 38: 
 39:         $oldIdSetter = $this->idSetter;
 40:         $this->idSetter = false;
 41: 
 42:         $result = '';
 43: 
 44:         $even = true;
 45: 
 46:         $levelElms = sizeof($tree);
 47:         $cnt = 1;
 48:         foreach ($tree as $item_tmp) {
 49:             $item = '';
 50:             $checked = '';
 51:             if (in_array($item_tmp['idpica_alloc'], $this->load)) {
 52:                 $checked = ' checked="checked"';
 53:             }
 54: 
 55:             $li_closeElm = '';
 56:             if ($cnt == $levelElms) {
 57:                 $li_closeElm = 'class="lastElem"';
 58:             }
 59:             $cnt++;
 60: 
 61:             $even = !$even;
 62:             $bgcolor = ($even) ? 'bright' : 'dark';
 63: 
 64:             // for wrapping purposes
 65:             $item_tmp['name'] = str_replace('-', '- ', $item_tmp['name']);
 66: 
 67:             $checkbox = '<input type="checkbox" name="allocation[]" onClick="addToList(this);" ' . $checked . '" id="e'.$item_tmp['idpica_alloc'].'" value="'.$item_tmp['idpica_alloc'].'">';
 68:             $item = "\n<li baseClass=\"" . $bgcolor . "\" ".$li_closeElm.">" . $checkbox . " " . $item_tmp['name'];
 69: 
 70:             $result .= $item;
 71: 
 72:             if ($item_tmp['children']) {
 73:                 $children = $this->_buildRenderTree($item_tmp['children']);
 74:                 $result .= "\n<ul>" . $children . "</li>";
 75:             } else {
 76:                 $result .= "\n</li>";
 77:             }
 78:         }
 79: 
 80:         if ($oldIdSetter === true) {
 81:             return "\n<ul id=\"finder\">" . $result . "\n</ul>";
 82:         } else {
 83:             return $result . "\n</ul>";
 84:         }
 85:     }
 86: 
 87:     function setChecked($load) {
 88:         $this->load = $load;
 89:     }
 90: 
 91:     function renderTree ($return = true) {
 92:         $tree = $this->fetchTree();
 93:         if ($tree === false) {
 94:             return false;
 95:         }
 96: 
 97:         $tree = $this->_buildRenderTree($tree);
 98:         if ($return === true) {
 99:             return $tree;
100:         }
101:     }
102: }
103: 
104: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0