Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function get_config(array $settings)
 {
     $forum_options = $this->forum_options->get_all();
     $group_options = $this->groups->get_data();
     $topic_type_options = array(POST_NORMAL => 'POST_NORMAL', POST_STICKY => 'POST_STICKY', POST_ANNOUNCE => 'POST_ANNOUNCEMENT', POST_GLOBAL => 'POST_GLOBAL');
     $sort_options = array('' => 'RANDOM', FORUMS_ORDER_FIRST_POST => 'FIRST_POST_TIME', FORUMS_ORDER_LAST_POST => 'LAST_POST_TIME', FORUMS_ORDER_LAST_READ => 'LAST_READ_TIME');
     return array('legend1' => 'SETTINGS', 'user_ids' => array('lang' => 'POLL_FROM_USERS', 'validate' => 'string', 'type' => 'textarea:3:40', 'maxlength' => 2, 'explain' => true, 'default' => ''), 'group_ids' => array('lang' => 'POLL_FROM_GROUPS', 'validate' => 'string', 'type' => 'multi_select', 'options' => $group_options, 'default' => array(), 'explain' => true), 'topic_ids' => array('lang' => 'POLL_FROM_TOPICS', 'validate' => 'string', 'type' => 'textarea:3:40', 'maxlength' => 2, 'explain' => true, 'default' => ''), 'forum_ids' => array('lang' => 'POLL_FROM_FORUMS', 'validate' => 'string', 'type' => 'multi_select', 'options' => $forum_options, 'default' => array(), 'explain' => true), 'topic_type' => array('lang' => 'TOPIC_TYPE', 'validate' => 'string', 'type' => 'checkbox', 'options' => $topic_type_options, 'default' => array(POST_NORMAL), 'explain' => false), 'order_by' => array('lang' => 'ORDER_BY', 'validate' => 'string', 'type' => 'select', 'options' => $sort_options, 'default' => 0, 'explain' => false));
 }
Exemplo n.º 2
0
 /**
  * Display blocks for current route
  *
  * @param bool $edit_mode
  * @param array $route_info
  * @param int $style_id
  * @param $display_modes
  */
 public function display($edit_mode, array $route_info, $style_id, array $display_modes)
 {
     $ex_positions = $route_info['ex_positions'];
     $users_groups = $this->groups->get_users_groups();
     $positions = $this->get_blocks_for_route($route_info, $style_id, $edit_mode);
     $blocks_per_position = array();
     foreach ($positions as $position => $blocks) {
         $pos_count_key = "s_{$position}_count";
         $blocks_per_position[$pos_count_key] = 0;
         $this->show_position($position, $blocks, $ex_positions, $users_groups, $blocks_per_position[$pos_count_key], $display_modes, $edit_mode);
     }
     $this->template->assign_var('S_HAS_BLOCKS', sizeof($positions));
     $this->template->assign_vars(array_change_key_case($blocks_per_position, CASE_UPPER));
 }
Exemplo n.º 3
0
 /**
  * Get the html form
  *
  * @param array $block_data
  * @return string
  */
 private function _get_form(array $block_data)
 {
     $selected_groups = $this->_ensure_array($block_data['permission']);
     $this->template->assign_vars(array('S_ACTIVE' => $block_data['status'], 'S_TYPE' => $block_data['type'], 'S_NO_WRAP' => $block_data['no_wrap'], 'S_HIDE_TITLE' => $block_data['hide_title'], 'S_BLOCK_CLASS' => trim($block_data['class']), 'S_GROUP_OPS' => $this->groups->get_options('special', $selected_groups)));
     $this->template->set_filenames(array('block_settings' => 'block_settings.html'));
     return $this->template->assign_display('block_settings');
 }