/** * When widget is called, following function is run. */ public function run() { // retrieve data from the global storage $data = MLinkList::get($this->id); // the new array of the links is a validated one $links = array(); if (isset($data['links']) && is_array($data['links'])) { foreach ($data['links'] as $link) { if (isset($link['visible']) && !$link['visible']) { continue; } if (is_array($link) && (isset($link['text']) || isset($link['url']) || isset($link['icon']) || isset($link['options']))) { $links[] = array('text' => isset($link['text']) ? (string) $link['text'] : '', 'url' => isset($link['url']) && (is_array($link['url']) || is_string($link['url'])) ? $link['url'] : '#', 'options' => isset($link['options']) && is_array($link['options']) ? $link['options'] : array()); $i = count($links) - 1; if (isset($link['icon']) && (is_string($link['icon']) || is_numeric($link['icon']))) { $links[$i]['icon'] = $link['icon']; } if (!isset($links[$i]['options']['title'])) { $links[$i]['options']['title'] = $links[$i]['text']; } } } } // do not display the widget if the data has no links if (($c = count($links)) === 0) { return null; } // set the default values and validate the data $area = $this->area === null ? $this->id : $this->area; if ($this->displayTitlebar === null) { $this->displayTitlebar = isset($data['displayTitlebar']) ? (bool) $data['displayTitlebar'] : true; } if ($this->title === null) { $this->title = isset($data['title']) ? (string) $data['title'] : Yii::t('t', 'Related links'); } else { $this->title = (string) $this->title; } // data for the renderer $data = array('area' => $area, 'c' => $c, 'displayTitlebar' => $this->displayTitlebar, 'links' => $links, 'title' => $this->title, 'class', 'n'); // render the view file $this->render('wLinkList', $data); // update the layout statistics if ($area === 'sidebar1') { MLayout::incrementNumberOfItemsSidebar1(); } else { if ($area === 'sidebar2') { MLayout::incrementNumberOfItemsSidebar2(); } } }
<div class="w3-user-flash-sidebar-summary ui-widget ui-state-highlight ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-info"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-sidebar-item --> <?php MLayout::incrementNumberOfItemsSidebar($in); } foreach ($error as $userFlash) { ?> <div class="w3-sidebar-item<?php echo MLayout::getNumberOfItemsSidebar($in) ? '' : ' w3-first'; ?> "> <div class="w3-user-flash-sidebar-summary ui-widget ui-state-error ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-alert"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-sidebar-item --> <?php MLayout::incrementNumberOfItemsSidebar($in); } ?> </div><!-- w3-user-flash-sidebar-summary-box -->
<div class="w3-user-flash-content-summary ui-widget ui-state-highlight ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-info"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-content-item --> <?php MLayout::incrementNumberOfItemsContent(); } foreach ($error as $userFlash) { ?> <div class="w3-content-item<?php echo MLayout::getNumberOfItemsContent() ? '' : ' w3-first'; ?> "> <div class="w3-user-flash-content-summary ui-widget ui-state-error ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-alert"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-content-item --> <?php MLayout::incrementNumberOfItemsContent(); } ?> </div><!-- w3-user-flash-content-summary-box -->
?> "> <?php echo $this->render('wMainMenuContent', array('items' => $items)); ?> </div> <div class="clear"> </div> </div> </div><!-- w3-main-menu-box --> <?php } else { ?> <div class="<?php echo MLayout::getContainerCssClass(); ?> "> <div class="<?php echo MLayout::getGridCssClass(); ?> "> <div class="w3-main-menu-box ui-widget ui-widget-header"> <?php echo $this->render('wMainMenuContent', array('items' => $items)); ?> <div class="clear"> </div> </div><!-- w3-main-menu-box --> </div> </div> <div class="clear"> </div> <?php }
<?php $class = ''; if ($area === 'sidebar1' || $area === 'sidebar2') { $class = 'w3-sidebar-item' . (MLayout::getNumberOfItemsSidebar($area) ? '' : ' w3-first'); } ?> <div<?php echo $class === '' ? '' : ' class="' . $class . '"'; ?> > <div class="w3-link-list-box"> <div class="ui-widget ui-widget-content ui-corner-all"> <?php if ($displayTitlebar) { ?> <div class="w3-link-list w3-titlebar ui-widget-header ui-corner-all"> <div class="w3-link-list w3-titlebar-button-box"> <div class="w3-link-list w3-titlebar-button"> <a class="w3-link-list w3-titlebar-close" href="javascript:void(0)"> <span class="ui-icon ui-icon-circle-triangle-n"></span> </a> </div><!-- w3-titlebar-button --> </div><!-- w3-titlebar-button-box --> <div class="w3-link-list w3-title"><?php echo $title; ?> </div> </div><!-- w3-titlebar --> <?php }
<div class="w3-user-flash-top-summary ui-widget ui-state-highlight ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-info"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-top-item --> <?php MLayout::incrementNumberOfItemsTop(); } foreach ($error as $userFlash) { ?> <div class="w3-top-item<?php echo MLayout::getNumberOfItemsTop() ? '' : ' w3-first'; ?> "> <div class="w3-user-flash-top-summary ui-widget ui-state-error ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-alert"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-top-item --> <?php MLayout::incrementNumberOfItemsTop(); } ?> </div><!-- w3-user-flash-top-summary-box -->
<?php MParams::setPageLabel(Yii::t('page', 'Migration tool')); MLayout::hideSidebars(); $this->widget('application.components.WContentHeader', array('displayBreadcrumbs' => false)); if (!empty($message)) { MUserFlash::setTopSuccess($message); } else { ?> <div class="w3-main-form-box ui-widget-content ui-corner-all"> <?php echo _CHtml::beginForm('', 'post', array('class' => 'w3-main-form')) . "\n"; ?> <div class="w3-form-row w3-first"> <div class="w3-form-row-input w3-form-row-2columns w3-center"> <?php echo _CHtml::submitButton(Yii::t('link', 'Migrate from our old Project Management System'), array('class' => 'w3-input-button ui-state-default ui-corner-all')) . "\n"; ?> </div> <div class="clear"> </div> </div> <?php echo _CHtml::endForm(); ?> </div><!-- w3-main-form-box --> <?php
/** * Load config/params.php params into MParams and MLayout. * Use MParams wrappers to avoid problems with wrong type or value out of range. */ public static function params() { MParams::load(); MLayout::load(); }
<div class="w3-user-flash-sidebar-summary ui-widget ui-state-highlight ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-info"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-sidebar-item --> <?php MLayout::incrementNumberOfItemsSidebar2(); } foreach ($error as $userFlash) { ?> <div class="w3-sidebar-item<?php echo MLayout::getNumberOfItemsSidebar2() ? '' : ' w3-first'; ?> "> <div class="w3-user-flash-sidebar-summary ui-widget ui-state-error ui-corner-all"> <span class="w3-icon-left ui-icon ui-icon-alert"></span> <?php echo $userFlash; ?> </div> </div><!-- w3-sidebar-item --> <?php MLayout::incrementNumberOfItemsSidebar2(); } ?> </div><!-- w3-user-flash-sidebar-summary-box -->
/** * GS wrap in css "grid_16" (sub)class. * If true, layout will look like <div class="container_16"><div class="grid_16">..header..</div></div> * If false, layout will look like <div class="container_16"><div class="">..header..</div></div> * @param bool $value */ public static function setWrapInGridCssClass($value) { if ($value === self::_default) { $value = self::defaultWrapInGridCssClass; } if (!is_bool($value)) { self::log(array('method' => __METHOD__, 'value' => $value)); $value = self::defaultWrapInGridCssClass; // set the wrong value to default } self::$wrapInGridCssClass = $value; }