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 article 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:  * Article class for content allocation
 22:  *
 23:  * @package    Plugin
 24:  * @subpackage ContentAllocation
 25:  */
 26: class pApiContentAllocationArticle extends pApiTree {
 27: 
 28:     var $tpl = null;
 29:     var $template = '';
 30: 
 31:     var $load = array();
 32: 
 33:     function pApiContentAllocationArticle ($uuid) {
 34:         global $cfg;
 35: 
 36:         parent::pApiTree($uuid);
 37:         $this->tpl = new cTemplate;
 38:         $this->template = $cfg['pica']['treetemplate_article'];
 39:     }
 40: 
 41:     function _buildRenderTree ($tree) {
 42:         global $action, $frame, $area, $sess, $idart;
 43: 
 44:         $result = array();
 45:         foreach ($tree as $item_tmp) {
 46:             $item = array();
 47: 
 48:             $expandCollapseImg = 'images/spacer.gif';
 49:             $expandCollapse = '<img class="vAlignMiddle" src="'.$expandCollapseImg.'" border="0" width="11" height="11">';
 50: 
 51:             $item['ITEMNAME'] = $expandCollapse . ' ' . $item_tmp['name'];
 52: 
 53:             $item['ITEMINDENT'] = $item_tmp['level'] * 15 + 3;
 54: 
 55:             // set checked!
 56:             $checked = '';
 57:             if (in_array($item_tmp['idpica_alloc'], $this->load)) {
 58:                 $checked = ' checked="checked"';
 59:             }
 60:             $item['CHECKBOX'] = '<input type="checkbox" name="allocation[]" value="'.$item_tmp['idpica_alloc'].'" '.$checked.'>';
 61: 
 62:             array_push($result, $item);
 63: 
 64:             if ($item_tmp['children']) {
 65:                 $children = $this->_buildRenderTree($item_tmp['children']);
 66:                 $result = array_merge($result, $children);
 67:             }
 68:         }
 69: 
 70:         return $result;
 71:     }
 72: 
 73:     function setChecked($load) {
 74:         $this->load = $load;
 75:     }
 76: 
 77:     function renderTree ($return = true) {
 78:         $this->tpl->reset();
 79: 
 80:         $tree = $this->fetchTree();
 81:         if ($tree === false) {
 82:             return false;
 83:         }
 84: 
 85:         $tree = $this->_buildRenderTree($tree);
 86: 
 87:         $even = true;
 88:         foreach ($tree as $item) {
 89:             $even = !$even;
 90:             $bgcolor = ($even) ? '#FFFFFF' : '#F1F1F1';
 91:             $this->tpl->set('d', 'BACKGROUND_COLOR', $bgcolor);
 92:             foreach ($item as $key => $value) {
 93:                 $this->tpl->set('d', $key, $value);
 94:             }
 95:             $this->tpl->next();
 96:         }
 97: 
 98:         $this->tpl->set('s', "CATEGORY", i18n("Category", 'content_allocation'));
 99: 
100:         if ($return === true) {
101:             return $this->tpl->generate($this->template, true);
102:         } else {
103:             $this->tpl->generate($this->template);
104:         }
105:     }
106: }
107: 
108: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0