/** * Run widget. */ public function run() { parent::run(); $this->htmlOptions['id'] = $this->map->id; echo Html::tag($this->tagName, $this->htmlOptions, ''); $this->onAfterRender(new \CEvent($this)); }
/** * Run the widget */ public function run() { $this->publishAssets(); $this->registerClientScripts(); $js = $this->createJsCode(); $this->clientScript->registerScript('jnotify_init', $js, CClientScript::POS_HEAD); parent::run(); }
public function run() { parent::run(); $criteria = new CDbCriteria(); $criteria->order = 't.order ASC'; $menu = Menu::model()->findAll($criteria); $this->render('home_menu_bar'); }
public function run() { /** @var $detector \Device */ $isMobile = Yii::app()->device->isDevice('mobile') ? true : false; parent::run(); $model = new Place(); $this->render($this->view ? $this->view : 'default', ['model' => $model, 'mobile' => $isMobile]); }
public function run() { parent::run(); $criteria = "(acos(sin({$this->newLat})*sin(radians(latitude)) + cos({$this->newLat})*cos(radians(latitude))*cos(radians(longitude)-({$this->newLng})))*{$this->radius})"; $limit = !empty($this->count) ? " LIMIT " . $this->count : ""; $command = Yii::app()->db->createCommand("SELECT *, " . $criteria . " AS 'distance' FROM transportStations WHERE " . $criteria . " <= " . $this->maxDistKm . " ORDER BY " . $criteria . $limit); $transportStations = $command->queryAll(); $this->render($this->view ? $this->view : 'default', ['transportStations' => $transportStations, 'thisLatitude' => $this->lat, 'thisLongitude' => $this->lng, 'mapObject' => $this->mapObject, 'mapJourneyButton' => $this->mapJourneyButton, 'id' => $this->id]); }
public function run() { parent::run(); $criteria = new CDbCriteria(); $criteria->order = 't.order ASC'; $menu = Menu::model()->findAll($criteria); $data['adv'] = Advertisement::model()->findAll("state = 1"); $this->render('bottom_logos', $data); }
public function run() { parent::run(); if ($this->dataProvider === null) { throw new CException(Yii::t('ext.mobile', '"dataProvider" field must be set.')); } if ($this->itemView === null) { throw new CException(Yii::t('ext.mobile', '"itemView" field must be set.')); } $this->render('body'); }
public function run() { $limit = NewsConfig::model()->findByPk(1, array('select' => 'widget_count')); $limit = $limit->widget_count; $criteria = new CDbCriteria(); $criteria->compare('public', 1); $criteria->limit = $limit; $criteria->order = 'date DESC'; $news = News::model()->findAll($criteria); $this->render('lastnews', array('news' => $news)); return parent::run(); }
public function run() { $attribute = $this->attribute; $idoftxtfield = get_class($this->model) . "_" . $this->attribute; $idoftxtfield2 = get_class($this->model) . "DD" . $this->attribute; $idofulmenu = get_class($this->model) . "-" . $this->attribute . "-ul"; $varname = $idoftxtfield . "js"; echo $this->form->hiddenField($this->model, $this->attribute); echo $this->getul($this->data, " id='" . $idofulmenu . "' class='mcdropdown_menu'"); echo "\n\t\t<input type=\"text\" size=\"45\" value=\"" . $this->model->{$attribute} . "\" id=\"" . $idoftxtfield2 . "\">\n\t\t<script type=\"text/javascript\">\n\t\tvar " . $varname . "=null;\n\t\t\$(document).ready(function (){\n\t\t\$('#" . $idoftxtfield2 . "').mcDropdown('#" . $idofulmenu . "',{allowParentSelect: true,select:function(){\n\t\t\$('#" . $idoftxtfield . "').val(" . $varname . ".getValue()[0]);\n\t}});\n\t" . $varname . "= \$('#" . $idoftxtfield2 . "').mcDropdown();\n\t});\n\n\t</script>"; parent::run(); }
/** * @return void */ public function run() { parent::run(); // save & clean buffer $content = ob_get_contents(); ob_end_clean(); if ($this->outputBuffer) { echo EModal::$buffer; } else { EModal::$buffer .= $this->render('modal', array('id' => $this->id, 'content' => $content), true); } }
public function run() { // this method is called by CController::endWidget() $this->publishAssets(); $this->registerClientScripts(); $this->htmlOptions['id'] = $this->getId(); echo "\n\n"; echo CHtml::openTag('div', $this->htmlOptions) . "\n"; echo 'The chart will appear within this DIV. This text will be replaced by the chart.' . "\n"; echo CHtml::closeTag('div'); // $this->renderChart(); parent::run(); echo "\n<!-- Fusion Chart " . $this->getId() . " -->\n"; }
public function run() { parent::run(); $js = ''; if (isset($this->watchElement)) { $js .= "\$('{$this->watchElement}').one('change', function() {"; } $js .= "\$(window).bind('beforeunload', function() {\r\r\n return \"" . $this->message . "\" ;\r\r\n });"; $js .= "\$('input[type=\"submit\"]').bind('click', function(){\r\r\n window.onbeforeunload = function(){};\r\r\n \$(window).unbind('beforeunload');\r\r\n });"; if (isset($this->watchElement)) { $js .= "});"; } Yii::app()->clientScript->registerCoreScript('jquery'); Yii::app()->clientScript->registerScript($this->getId(), $js, CClientScript::POS_READY); }
public function run() { $galleryConfig = GalleryConfig::model()->find(); $displayMode = $galleryConfig->display_mode; switch ($displayMode) { case 0: $gallery = Gallery::getFirstGallery(); break; case 1: $gallery = Gallery::getRandomGallery(); break; case 2: $gallery = Gallery::getSelectedGallery($galleryConfig->selected_gallery_id); break; } $this->render('gallery', array('gallery' => $gallery)); return parent::run(); }
/** * @method run */ public function run() { $reviewsConfig = ReviewsConfig::model()->find(); $criteria = new CDbCriteria(); $criteria->order = 'date_create DESC'; if ($reviewsConfig->premoder and Yii::app()->user->isGuest) { $criteria->condition = 'public = :public'; $criteria->params = array(':public' => true); } $dataProvider = Reviews::model()->findAll($criteria); /* $dataProvider = new CActiveDataProvider('Reviews', array( 'criteria' => $criteria, 'pagination' => false, )); */ $this->render('reviews', array('dataProvider' => $dataProvider)); return parent::run(); }
public function run() { parent::run(); $model = new Deal(); $this->render($this->view ? $this->view : 'default', array('model' => $model, 'type' => $this->type, 'minPrices' => Util::getPropertyPrices("minimum"), 'maxPrices' => Util::getPropertyPrices("maximum"), 'isMobile' => Yii::app()->device->isDevice('mobile'))); }
public function run() { parent::run(); }
/** * Run the addThis widget. * This renders the body part of the assThis widget. */ function run() { // Run parent CWidget run function. parent::run(); //mantu agregó el span echo '<span style="font-size:11px">'; // Get this widget id. $id = $this->getId(); // Set this widget id. $this->htmlOptions['id'] = $id; // Set the default 'class' attribute of addThis 'div' otherwise add users custom 'class' attribute. empty($this->htmlOptions['class']) ? $this->htmlOptions['class'] = 'addthis_toolbox addthis_default_style' : ($this->htmlOptions['class'] = 'addthis_toolbox ' . $this->htmlOptions['class']); // Open default addThis div tag with htmlOptions. echo CHtml::openTag('div', $this->htmlOptions) . "\n"; // Open default addThis button if showDefaultButton is set to true. if ($this->showDefaultButton) { // Set the default addThis link url. $this->linkOptions['href'] = $this->linkUrl; // Set the default 'class' attribute of addThis link otherwise set to user defined 'class'. empty($this->linkOptions['class']) ? $this->linkOptions['class'] = 'addthis_button_compact' : ''; // Print default addThis button link tag. echo CHtml::openTag('a', $this->linkOptions); // Print default addThis button caption if showDefaultButtonCaption is set to true. if ($this->showDefaultButtonCaption) { echo $this->defaultButtonCaption; } // Close default addThis button link tag. echo CHtml::closeTag('a') . "\n"; } // Check what services to show. if (isset($this->showServices)) { foreach ($this->showServices as $i) { if ($i != 'separator') { echo CHtml::openTag('a', array('class' => "addthis_button_{$i}")); if ($this->showServicesTitle && $i != 'facebook_like') { echo ucfirst("{$i}"); } echo CHtml::closeTag('a') . "\n"; } else { echo CHtml::openTag('span', array('class' => "addthis_{$i}")); //echo "{$this->separator}"; echo CHtml::closeTag('span') . "\n"; } } // Destroy @var showServices. unset($this->showServices); } // Close default addThis div tag. echo CHtml::closeTag('div'); echo '<!-- AddThis id:{$this->id}-->'; // Register script file, addThis config and share if are set. $scriptFileUri = isset($this->username) ? $scriptFileUri = "{$this->scriptUrl}#username={$this->username}" : ($scriptFileUri = "{$this->scriptUrl}"); Yii::app()->clientScript->registerScriptFile($scriptFileUri); // Check if addThis $config parametes are set if true place them. if (!empty($this->config)) { $config = CJavaScript::encode($this->config); Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, "var addthis_config={$config};", false); } // Destroy addThis #config parameters. unset($this->config); // Check if addThis $share parametes are set if true place them. if (!empty($this->share)) { $share = CJavaScript::encode($this->share); Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, "var addthis_share={$share};", false); } // Destroy addThis #share parameters. unset($this->share); //mantu agregó el span echo "</span>"; }
/** * Run the widget */ public function run() { if (!$this->visible) { return $this->getViewFile('adGallery'); } //Why do I have to do this? Unkown but rendering the file doesn't work unless I call this $this->render('adGallery', array('imageList' => $this->imageList)); parent::run(); }
/** * Run the widget */ public function run() { parent::run(); $this->getViewFile($this->itemView); $this->render($this->itemView, array('data', $this->data)); }
/** * Executes the widget. */ public function run() { parent::run(); echo CHtml::tag($this->tag, $this->htmlOptions, CHtml::link($this->name, $this->file, array('class' => 'jouele'))); $this->registerScripts(); }
public function run() { echo "hahahahha"; parent::run(); }
public function run() { parent::run(); // Render settings $this->renderSettings(); // Render buttons $this->renderButtons(); // Render additional HTML $this->renderAdditionalHtml(); // End form $this->endForm(); }
/** * @method run */ public function run() { if ($bannerarea = Bannerarea::model()->find('name=:name', array('name' => $this->areaname))) { $banners = array(); $typeRotation = false; $criteria = new CDbCriteria(); $criteria->condition = 'bannerarea=:bannerarea AND notactive<>1'; $criteria->params = array('bannerarea' => $bannerarea->id); switch ($bannerarea->mode) { case Bannerarea::SHOW_ALL: $criteria->order = 'sort_order'; break; case Bannerarea::RANDOM_ALL: $criteria->order = new CDbExpression('RAND()'); break; } $dataProvider = new CActiveDataProvider('Banners', array('criteria' => $criteria)); switch ($bannerarea->mode) { case Bannerarea::ONE_AT_ROTATION: // Поочередная ротация $typeRotation = true; $dataProvider->pagination->pageSize = 1; // Увеличиваем номер очередного баннера на 1 if (isset($bannerarea->queue)) { $bannerarea->queue = $bannerarea->queue + 1; } else { $bannerarea->queue = 0; } // Если номер больше, чем общее количество - обнуляем if ($bannerarea->queue > $dataProvider->totalItemCount - 1) { $bannerarea->queue = 0; } // Устанавливаем текущую страницу $dataProvider->pagination->currentPage = $bannerarea->queue; // Сохраняем номер очередной просмотренной страницы $bannerarea->save(); break; case Bannerarea::RANDOM_ROTATION: $typeRotation = true; $dataProvider->pagination->pageSize = 1; // Генерируем случайным образом номер баннера для показа $bannerarea->queue = mt_rand(0, $dataProvider->totalItemCount - 1); // Устанавливаем текущую страницу $dataProvider->pagination->currentPage = $bannerarea->queue; // Сохраняем номер очередной просмотренной страницы $bannerarea->save(); break; case Bannerarea::SLIDER: $this->viewName = 'slider'; $banners = Banners::model()->findAll($criteria); break; default: $dataProvider->pagination = false; break; } $this->render($this->viewName, array('dataProvider' => $dataProvider, 'itemViewName' => $this->itemViewName, 'banners' => $banners, 'typeRotation' => $typeRotation)); return parent::run(); } else { echo 'Рекламное место ' . $this->areaname . 'не найдено!'; } }
public function run() { parent::run(); echo '</div>'; }
/** * Run the widget */ public function run() { $this->publishAssets(); $this->registerClientScripts(); $js = $this->createJsCode(); $this->clientScript->registerScript('jqform_' . $this->getId(), $js, CClientScript::POS_HEAD); parent::run(); }
/** * Render the widget * Uses the subclass $tagName property to render tag */ public function run() { parent::run(); $params = $this->getParams(); $this->renderTag($this->tagName, $params); }
public function run() { $this->render('layoutEditor', array('namespace' => 'profile')); parent::run(); }
/** * run() - run this function when widget ends. * At last level, We've to just render view for slider with all items you gave in widget. */ public function run() { $this->render('_slider', array('items' => $this->items, 'options' => $this->options)); // render view file which is in "views/_slider.php" return parent::run(); }
/** * Executes the widget. * This method is called by {@link CBaseController::endWidget}. */ public function run() { parent::run(); $this->registerAssets(); $this->render('auth', array('id' => $this->getId(), 'services' => $this->services, 'action' => $this->action)); }
/** * Run the widget */ public function run() { $this->publishAssets(); $this->registerClientScripts(); $js = $this->createJsCode(); $this->clientScript->registerScript('js_eswfobject' . $this->randomID, $js, CClientScript::POS_HEAD); if ($this->containerId == null) { echo $this->createHtml(); } parent::run(); }