/** * 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.')); } }
/** * 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.')); } }
/** * 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.')); } }