示例#1
0
 public function init()
 {
     if (!$this->title) {
         $this->title = Yii::t('app', 'Latest News');
     }
     parent::init();
 }
示例#2
0
文件: Events.php 项目: awecode/awecms
 public function init()
 {
     if (!$this->title) {
         $this->title = Yii::t('app', 'Upcoming Events');
     }
     parent::init();
 }
示例#3
0
 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();
 }
示例#4
0
 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();
 }
示例#5
0
文件: BlockW.php 项目: awecode/awecms
 public function init()
 {
     $this->title = $this->block->title;
     //        $this->cssClass = $block->css_class;
     //        print_r($this->block->attributes);
     //        die();
     $this->headerCssClass = $this->block->title_css_class;
     $this->contentCssClass = $this->block->content_css_class;
     $this->visible = $this->block->enabled;
     parent::init();
 }
示例#6
0
 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();
 }
示例#7
0
文件: Share.php 项目: awecode/awecms
 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();
 }