/** * Render additional <head>. * * @return string */ public function head() { return Widget::get('head'); }
?> <span class="label label-info"><?php echo !empty($db['noOfCollecton']) ? $db['noOfCollecton'] : ''; ?> </span></a> <?php } ?> </ul> <?php } else { foreach ($dbList['databases'] as $db) { if ($dbName == $db['name']) { $collectionList = Widget::get('CollectonList'); ?> <a href="#accounts-menu" class="nav-header" data-toggle="collapse"> <i class="icon-database"></i><?php echo $db['name']; ?> <span class="label label-info"><?php echo $db['noOfCollecton']; ?> </span></a> <?php if ($collectionList) { ?> <ul id="accounts-menu" class="nav nav-list collapse in"> <?php foreach ($collectionList as $collection) {
/** * @param DataObjectInterface $record */ public function saveInto(DataObjectInterface $record) { $name = $this->name; $idName = $name . "ID"; $widgetarea = $record->getComponent($name); $widgetarea->write(); $record->{$idName} = $widgetarea->ID; $widgets = $widgetarea->Items(); // store the field IDs and delete the missing fields // alternatively, we could delete all the fields and re add them $missingWidgets = array(); if ($widgets) { foreach ($widgets as $existingWidget) { $missingWidgets[$existingWidget->ID] = $existingWidget; } } if (!$this->getForm()) { throw new Exception("no form"); } $widgetData = $this->getForm()->getRequest()->requestVar('Widget'); if ($widgetData && isset($widgetData[$this->getName()])) { $widgetAreaData = $widgetData[$this->getName()]; foreach ($widgetAreaData as $newWidgetID => $newWidgetData) { // Sometimes the id is "new-1" or similar, ensure this doesn't get into the query if (!is_numeric($newWidgetID)) { $newWidgetID = 0; } $widget = null; if ($newWidgetID) { // \"ParentID\" = '0' is for the new page $widget = Widget::get()->filter('ParentID', array(0, $record->{$name}()->ID))->byID($newWidgetID); // check if we are updating an existing widget if ($widget && isset($missingWidgets[$widget->ID])) { unset($missingWidgets[$widget->ID]); } } // create a new object if (!$widget && !empty($newWidgetData['Type']) && class_exists($newWidgetData['Type']) && is_subclass_of($newWidgetData['Type'], 'Widget')) { $widget = Injector::inst()->create($newWidgetData['Type']); $widget->ID = 0; $widget->ParentID = $record->{$name}()->ID; } if ($widget) { if ($widget->ParentID == 0) { $widget->ParentID = $record->{$name}()->ID; } $widget->populateFromPostData($newWidgetData); } } } // remove the fields not saved if ($missingWidgets) { foreach ($missingWidgets as $removedWidget) { if (isset($removedWidget) && is_numeric($removedWidget->ID)) { $removedWidget->delete(); } } } }
<div class="info"></div> </div> </div> </div> <a class="navi prev" title="<?php echo __('Previous'); ?> ">«</a> <a class="navi next" title="<?php echo __('Next'); ?> ">»</a> <a class="action close" title="<?php echo __('Close'); ?> ">✖</a> </div> <?php echo HTML::script_source("\nhead.js(\n\t{ 'jquery': 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' },\n\t{ 'jquery-ui': 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js' },\n\t{ 'jquery-tools': '" . URL::base() . "js/jquery.tools.min.js' },\n\t{ 'jquery-form': '" . URL::base() . "js/jquery.form.js' },\n\t{ 'jquery-overflow': '" . URL::base() . "js/jquery.text-overflow.js' },\n\t{ 'jquery-imgarea': '" . URL::base() . "js/jquery.imgareaselect.js' },\n\t{ 'jquery-scroll': '" . URL::base() . "js/jquery-scrolltofixed-min.js' },\n\t{ 'jquery-markitup': '" . URL::base() . "js/jquery.markitup.pack.js' },\n\t{ 'jquery-bbcode': '" . URL::base() . "js/markitup.bbcode.js' },\n\t{ 'anqh': '" . URL::base() . "js/anqh.js?2' },\n\tfunction() {\n\t\tAnqh.geoNamesURL = '" . Kohana::$config->load('geo.base_url') . "';\n\t\tAnqh.geoNamesUser = '******'geo.username') . "';\n\t}\n);\n"); ?> <?php echo Widget::get('foot'); ?> </body> </html>
/** * Render <head>. * * @return string */ protected function _head() { ob_start(); ?> <head> <meta charset="<?php echo Kohana::$charset; ?> " /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo Kohana::$charset; ?> " /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <title><?php echo $this->title ? HTML::chars($this->title) : Kohana::$config->load('site.site_name'); ?> </title> <link rel="icon" type="image/png" href="<?php echo $this->base; ?> ui/favicon.png" /> <?php echo HTML::style('static/css/anqh.css?_=' . filemtime('static/css/anqh.css')); ?> <?php echo HTML::style('//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css'); ?> <?php echo HTML::style('//cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.min.css'); ?> <?php echo HTML::style('//cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2-bootstrap.css'); ?> <?php echo HTML::script('//cdnjs.cloudflare.com/ajax/libs/headjs/1.0.3/head.load.js'); ?> <?php echo $this->_open_graph(); ?> <?php echo Widget::get('head'); ?> <?php echo Ads::head(); ?> </head> <?php return ob_get_clean(); }
</a></li> <?php } ?> <li id="fat-menu" class="dropdown"> <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-user"></i><?php echo I18n::t('LAN'); ?> <i class="icon-caret-down"></i> </a> <ul class="dropdown-menu"> <?php $languageList = Widget::get('languageList'); foreach ($languageList as $key => $val) { ?> <li><a tabindex="-1" href="<?php echo Theme::URL('Index/SetLanguage', array('language' => $key)); ?> "><?php echo $val; ?> </a></li> <?php } ?> </ul> </li>
protected function loadWidgetFromPhp(Widget $widget, $src) { $path = $this->kernel->findFileOnPath($src, $this->kernel->getWidgetsPath()); if ($path) { $meta = $this->getFileMeta($path); $widgetData = $widget->get(); include_once $path; $extWidget = new $meta['class']($this->kernel, $widgetData); $extWidget->bootstrap(); return $extWidget->get(); } return array(); }
protected function loadWidgetFromPhp(Widget $widget, $src) { $widgetData = $widget->get(); $path = $this->kernel->findFileOnPath($src, $this->kernel->getWidgetsPath()); $widgetClass; $phpWidget; if (class_exists($src)) { $widgetClass = $src; } else { if ($path) { $meta = $this->getFileMeta($path); $widgetClass = $meta['class']; include_once $path; } else { return []; } } $phpWidget = $this->bootstrapWidget($widgetClass, $widgetData); return $phpWidget->get(); }