コード例 #1
0
ファイル: theme.php プロジェクト: ringmaster/system
 /**
  * Add the K2 menu block to the nav area upon theme activation if there's nothing already there
  */
 public function action_theme_activated()
 {
     $blocks = $this->get_blocks('nav', 0, $this);
     if (count($blocks) == 0) {
         $block = new Block(array('title' => _t('K2 Menu'), 'type' => 'k2_menu'));
         $block->add_to_area('nav');
         Session::notice(_t('Added K2 Menu block to Nav area.'));
     }
 }
コード例 #2
0
ファイル: theme.php プロジェクト: habari-extras/gray
 /**
  * On theme activation, activate some default blocks
  */
 public function action_theme_activated()
 {
     $blocks = $this->get_blocks('primary', '', $this);
     if (count($blocks) == 0) {
         $block = new Block(array('title' => _t('Posts'), 'type' => 'grayposts'));
         $block->add_to_area('primary');
         Session::notice(_t('Added default blocks to theme areas.'));
     }
 }
コード例 #3
0
ファイル: theme.php プロジェクト: ringmaster/system
 /**
  * On theme activation, set the default options and activate a default menu
  */
 public function action_theme_activated()
 {
     $opts = Options::get_group(__CLASS__);
     if (empty($opts)) {
         Options::set_group(__CLASS__, $this->defaults);
     }
     $blocks = $this->get_blocks('nav', 0, $this);
     if (count($blocks) == 0) {
         $block = new Block(array('title' => _t('Charcoal Menu'), 'type' => 'charcoal_menu'));
         $block->add_to_area('nav');
         Session::notice(_t('Added Charcoal Menu block to Nav area.'));
     }
 }