public function run() { $pages = Page::model()->getRecentPages(); ?> <ul> <?php foreach ($pages as $page) { ?> <li> <?php $title = CHtml::encode($page->title); echo CHtml::link($title, $page->url); ?> </li> <?php } ?> <?php if (!$pages) { echo Yii::t('app', 'Sorry, no recent pages!'); } ?> </ul> <?php parent::run(); }
public function run() { if ($this->info) { $rep = array('date-np' => $this->info['date']['np'], 'month-np' => $this->info['month']['np'], 'year-np' => $this->info['year']['np'], 'date-en' => $this->info['date']['en'], 'month-en' => $this->info['month']['en'], 'year-en' => $this->info['year']['en'], 'day-np' => $this->info['day']['np'], 'day-en' => $this->info['day']['en'], 'event-en' => $this->info['event']['en'], 'event-np' => $this->info['event']['np'], 'tithi-en' => $this->info['tithi']['en'], 'tithi-np' => $this->info['tithi']['np'], 'eng-date' => $this->info['eng-date']); $result = str_replace(array_map('self::maskit', array_keys($rep)), array_values($rep), $this->format); echo $result; } parent::run(); }
public function run() { $tags = Page::model()->getAllTagsWithModelsCount(array('order' => 'count DESC', 'limit' => $this->maxTags)); $weight = $this->findTagWeights($tags); asort($tags); foreach ($tags as $tag) { if ($tag['count'] >= 1) { $lnk = ''; if (!in_array($tag['name'], array('tag', 'index', 'json', 'view', 'delete'))) { $lnk = array('/tag/' . $tag['name']); } else { $id = Tag::model()->findByAttributes(array('name' => $tag['name']))->id; $lnk = array('/tag/tag/view', 'id' => $id); } $link = CHtml::link(CHtml::encode($tag['name']), $lnk); echo CHtml::tag('span', array('class' => 'tagcloud', 'style' => "font-size:" . (2 + $weight[$tag['name']]) . "pt"), $link) . CHtml::tag('span', array('style' => "font-size:8pt"), $tag['count'] > 1 ? '(' . $tag['count'] . ') ' : ' '); } } parent::run(); }
public function run() { $iconsDir = Yii::app()->assetManager->publish(__DIR__ . DIRECTORY_SEPARATOR . 'icons', false, -1); $rep = array('url' => $this->url, 'text' => $this->text, 'via' => $this->via); foreach ($this->networks as $name => $network) { if (!in_array(strtolower($name), array_map('strtolower', $this->shareTo))) { continue; } $url = str_replace(array_map('self::maskit', array_keys($rep)), array_values($rep), $network['format']); if (Awecms::isUrl($network['icon'])) { $icon = $network['icon']; } else { $icon = $iconsDir . '/' . $network['icon']; } $str = '<a href="' . $url . '"'; if ($this->openInNewTab) { $str .= ' target="_blank"'; } $str .= 'title="' . $network['tip'] . '"><img src="' . $icon . '" alt="' . $name . '"></a>'; echo $str; } parent::run(); }