Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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

  • cGuiBackendHelpbox
  • cGuiFileOverview
  • cGuiFoldingRow
  • cGuiList
  • cGuiMenu
  • cGuiNavigation
  • cGuiNotification
  • cGuiObjectPager
  • cGuiPage
  • cGuiScrollList
  • cGuiSourceEditor
  • cGuiTableForm
  • cGuiTree
  • cPager
  • cTemplate
  • cTree
  • cTreeItem
  • NoteLink
  • NoteList
  • NoteListItem
  • NoteView
  • TODOLink
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the menu GUI class.
  5:  *
  6:  * @package          Core
  7:  * @subpackage       GUI
  8:  * @version          SVN Revision $Rev:$
  9:  *
 10:  * @author           Mischa Holz
 11:  * @copyright        four for business AG <www.4fb.de>
 12:  * @license          http://www.contenido.org/license/LIZENZ.txt
 13:  * @link             http://www.4fb.de
 14:  * @link             http://www.contenido.org
 15:  */
 16: 
 17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 18: 
 19: /**
 20:  * Menu GUI class
 21:  *
 22:  * @package    Core
 23:  * @subpackage GUI
 24:  */
 25: class cGuiMenu {
 26: 
 27:     /**
 28:      *
 29:      * @var array
 30:      */
 31:     public $link;
 32: 
 33:     /**
 34:      *
 35:      * @var array
 36:      */
 37:     public $title;
 38: 
 39:     /**
 40:      *
 41:      * @var array
 42:      */
 43:     public $tooltips;
 44: 
 45:     /**
 46:      *
 47:      * @var array
 48:      */
 49:     public $image;
 50: 
 51:     /**
 52:      *
 53:      * @var unknown_type
 54:      */
 55:     public $alt;
 56: 
 57:     /**
 58:      *
 59:      * @var array
 60:      */
 61:     public $actions;
 62: 
 63:     /**
 64:      *
 65:      * @var array
 66:      */
 67:     public $imagewidth;
 68: 
 69:     /**
 70:      *
 71:      * @todo what is this property supposed to be?
 72:      * @var unknown_type
 73:      */
 74:     public $caption;
 75: 
 76:     /**
 77:      *
 78:      * @todo what is this property supposed to be?
 79:      * @var unknown_type
 80:      */
 81:     public $type;
 82: 
 83:     /**
 84:      *
 85:      * @todo what is this property supposed to be?
 86:      * @var unknown_type
 87:      */
 88:     public $show;
 89: 
 90:     /**
 91:      * The marked item.
 92:      *
 93:      * @var mixed
 94:      */
 95:     protected $_marked = false;
 96: 
 97:     /**
 98:      *
 99:      */
100:     public function __construct() {
101:         $this->rowmark = true;
102:     }
103: 
104:     /**
105:      *
106:      * @param mixed $item
107:      * @param string $title
108:      */
109:     public function setTitle($item, $title) {
110:         $this->title[$item] = $title;
111:     }
112: 
113:     /**
114:      *
115:      * @param mixed $item
116:      * @param string $tooltip
117:      */
118:     public function setTooltip($item, $tooltip) {
119:         $this->tooltips[$item] = $tooltip;
120:     }
121: 
122:     /**
123:      *
124:      * @param bool $rowmark [optional]
125:      */
126:     public function setRowmark($rowmark = true) {
127:         $this->rowmark = $rowmark;
128:     }
129: 
130:     /**
131:      *
132:      * @param mixed $item
133:      * @param string $image
134:      * @param int $maxwidth [optional]
135:      */
136:     public function setImage($item, $image, $maxwidth = 0) {
137:         $this->image[$item] = $image;
138:         $this->imagewidth[$item] = $maxwidth;
139:         $this->show[$item] = '';
140:     }
141: 
142:     /**
143:      *
144:      * @param mixed $item
145:      * @param cHTMLContentElement $link
146:      */
147:     public function setLink($item, $link) {
148:         $this->link[$item] = $link;
149:     }
150: 
151:     /**
152:      *
153:      * @param mixed $item
154:      * @param mixed $key
155:      * @param string $action
156:      */
157:     public function setActions($item, $key, $action) {
158:         $this->actions[$item][$key] = $action;
159:     }
160: 
161:     /**
162:      *
163:      * @param mixed $item
164:      */
165:     public function setMarked($item) {
166:         $this->_marked = $item;
167:     }
168: 
169:     /**
170:      *
171:      * @param bool $print [optional]
172:      * @return Ambigous <string, void, mixed>
173:      */
174:     public function render($print = true) {
175:         global $cfg;
176: 
177:         $tpl = new cTemplate;
178: 
179:         $tpl->reset();
180: 
181:         if (is_array($this->link)) {
182:             foreach ($this->link as $key => $value) {
183:                 if ($value != NULL) {
184:                     if ($this->imagewidth[$key] != 0) {
185:                         $value->setContent('<img border="0" alt="" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">');
186:                         $img = $value->render();
187:                     } else {
188:                         $value->setContent('<img border="0" alt="" src="' . $this->image[$key] . '">');
189:                         $img = $value->render();
190:                     }
191:                     $value->setContent($this->title[$key]);
192:                     $link = $value->render();
193:                 } else {
194:                     $link = $this->title[$key];
195: 
196:                     if ($this->image[$key] != "") {
197:                         if ($this->imagewidth[$key] != 0) {
198:                             $img = '<img border="0" alt="" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">';
199:                         } else {
200:                             $img = '<img border="0" alt="" src="' . $this->image[$key] . '">';
201:                         }
202:                     } else {
203:                         $img = "&nbsp;";
204:                     }
205:                 }
206: 
207:                 $tpl->set('d', 'NAME', $link);
208: 
209:                 if ($this->image[$key] == "") {
210:                     $tpl->set('d', 'ICON', '');
211:                 } else {
212:                     $tpl->set('d', 'ICON', $img);
213:                 }
214: 
215:                 $extra = "";
216:                 if ($this->rowmark == true) {
217:                     $extra .= 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)" ';
218:                 }
219:                 if ($this->_marked === $key) {
220:                     $extra .= "id='marked' ";
221:                 }
222:                 if ($this->tooltips[$key] != "") {
223:                     $extra .= "class='tooltip-north' original-title='" . $this->tooltips[$key] . "' ";
224:                 }
225:                 $tpl->set('d', 'EXTRA', $extra);
226: 
227:                 $fullactions = "";
228:                 if (is_array($this->actions[$key])) {
229: 
230:                     $fullactions = '<table border="0"><tr>';
231: 
232:                     foreach ($this->actions[$key] as $key => $singleaction) {
233:                         $fullactions .= '<td nowrap="nowrap">' . $singleaction . '</td>';
234:                     }
235: 
236:                     $fullactions .= '</tr></table>';
237:                 }
238: 
239:                 $tpl->set('d', 'ACTIONS', $fullactions);
240:                 $tpl->next();
241:             }
242:         }
243:         $rendered = $tpl->generate(cRegistry::getBackendPath() . $cfg['path']['templates'] . $cfg['templates']['generic_menu'], true);
244: 
245:         if ($print == true) {
246:             echo $rendered;
247:         } else {
248:             return $rendered;
249:         }
250:     }
251: 
252: }
253: 
CMS CONTENIDO 4.9.8 API documentation generated by ApiGen 2.8.0