/**
  * Load icon picker
  */
 public function picker()
 {
     $this->user->add_lang_ext('blitze/sitemaker', 'icons');
     $this->sitemaker->add_assets(array('js' => array('@blitze_sitemaker/assets/icons/picker.min.js'), 'css' => array('@blitze_sitemaker/vendor/fontawesome/css/font-awesome.min.css', '@blitze_sitemaker/assets/icons/picker.min.css')));
     $this->ptemplate->set_style(array("ext/blitze/sitemaker/styles"));
     $this->ptemplate->set_filenames(array('icons' => 'icon_picker.html'));
     return $this->ptemplate->assign_display('icons');
 }
Beispiel #2
0
 public function build(array $topic_data, \phpbb\template\twig\twig &$template)
 {
     $this->user->add_lang('viewtopic');
     $forum_id = (int) $topic_data['forum_id'];
     $topic_id = (int) $topic_data['topic_id'];
     $cur_voted_id = $this->_get_users_votes($topic_id);
     $s_can_vote = $this->_user_can_vote($forum_id, $topic_data, $cur_voted_id);
     $viewtopic_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "f={$forum_id}&t={$topic_id}");
     $poll_total = $poll_most = 0;
     $poll_info = $this->_get_poll_info($topic_data, $poll_total, $poll_most);
     $poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
     $this->_build_poll_options($cur_voted_id, $poll_info, $poll_total, $poll_most, $template);
     $template->assign_vars(array('POLL_QUESTION' => $topic_data['poll_title'], 'TOTAL_VOTES' => $poll_total, 'POLL_LEFT_CAP_IMG' => $this->user->img('poll_left'), 'POLL_RIGHT_CAP_IMG' => $this->user->img('poll_right'), 'L_MAX_VOTES' => $this->user->lang('MAX_OPTIONS_SELECT', (int) $topic_data['poll_max_options']), 'L_POLL_LENGTH' => $this->_get_poll_length_lang($topic_data['poll_length'], $poll_end), 'S_CAN_VOTE' => $s_can_vote, 'S_DISPLAY_RESULTS' => $this->_show_results($s_can_vote, $cur_voted_id), 'S_IS_MULTI_CHOICE' => $this->_poll_is_multiple_choice($topic_data['poll_max_options']), 'S_POLL_ACTION' => $viewtopic_url, 'S_FORM_TOKEN' => $this->sitemaker->get_form_key('posting'), 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll'));
 }
 public function show()
 {
     $this->util->add_assets(array('css' => array($this->util->asset_path . 'ext/blitze/sitemaker/components/fontawesome/css/font-awesome.min.css')));
     $this->template->assign_var('L_INDEX', $this->user->lang('HOME'));
     if ($this->page_can_have_blocks() === false) {
         return;
     }
     $edit_mode = $this->toggle_edit_mode();
     $route = $this->get_route();
     $style_id = $this->get_style_id();
     $display_mode = $this->get_display_modes();
     $u_edit_mode = $this->get_edit_mode_url($edit_mode, $display_mode);
     $blocks = $this->phpbb_container->get('blitze.sitemaker.blocks');
     $route_info = $blocks->get_route_info($route, $style_id, $edit_mode);
     $this->show_admin_bar($edit_mode, $route_info);
     $blocks->display($edit_mode, $route_info, $style_id, $display_mode);
     $this->template->assign_vars(array('S_SITEMAKER' => true, 'U_EDIT_MODE' => $u_edit_mode));
 }
 public function main()
 {
     $menu_id = $this->request->variable('menu_id', 0);
     $menu_mapper = $this->mapper_factory->create('menus', 'menus');
     // Get all menus
     $collection = $menu_mapper->find();
     if ($collection->valid()) {
         $menu = isset($collection[$menu_id]) ? $collection[$menu_id] : $collection->current();
         $menu_id = $menu->get_menu_id();
         foreach ($collection as $entity) {
             $id = $entity->get_menu_id();
             $this->template->assign_block_vars('menu', array('ID' => $id, 'NAME' => $entity->get_menu_name(), 'S_ACTIVE' => $id == $menu_id ? true : false));
         }
     }
     nestedset::load_scripts($this->util);
     $this->util->add_assets(array('js' => array('@blitze_sitemaker/assets/menu/admin.min.js'), 'css' => array('@blitze_sitemaker/assets/menu/admin.min.css')));
     $this->template->assign_vars(array('S_MENU' => true, 'MENU_ID' => $menu_id, 'ICON_PICKER' => $this->icon->picker(), 'T_PATH' => $this->phpbb_root_path, 'UA_MENU_ID' => $menu_id, 'UA_AJAX_URL' => "{$this->phpbb_root_path}app.{$this->php_ext}/menu/admin/"));
     $this->tpl_name = 'acp_menu';
     $this->page_title = 'ACP_MENU';
 }
 /**
  * {@inheritdoc}
  */
 public function display(array $bdata, $edit_mode = false)
 {
     $this->user->add_lang('viewtopic');
     $this->settings = $bdata['settings'];
     if (!($topic_data = $this->_get_topic_data())) {
         return array('title' => '', 'content' => '');
     }
     $forum_id = (int) $topic_data['forum_id'];
     $topic_id = (int) $topic_data['topic_id'];
     $viewtopic_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "f={$forum_id}&t={$topic_id}");
     $cur_voted_id = $this->_get_users_votes($topic_id);
     $s_can_vote = $this->_user_can_vote($forum_id, $topic_data, $cur_voted_id);
     $poll_total = $poll_most = 0;
     $poll_info = $this->_get_poll_info($topic_data, $poll_total, $poll_most);
     $poll_info = $this->_parse_poll($topic_data, $poll_info);
     $poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
     $this->_build_poll_options($cur_voted_id, $poll_info, $poll_total, $poll_most);
     $this->ptemplate->assign_vars(array('POLL_QUESTION' => $topic_data['poll_title'], 'TOTAL_VOTES' => $poll_total, 'POLL_LEFT_CAP_IMG' => $this->user->img('poll_left'), 'POLL_RIGHT_CAP_IMG' => $this->user->img('poll_right'), 'L_MAX_VOTES' => $this->user->lang('MAX_OPTIONS_SELECT', (int) $topic_data['poll_max_options']), 'L_POLL_LENGTH' => $this->_get_poll_length_lang($topic_data['poll_length'], $poll_end), 'S_CAN_VOTE' => $s_can_vote, 'S_DISPLAY_RESULTS' => $this->_show_results($s_can_vote, $cur_voted_id), 'S_IS_MULTI_CHOICE' => $this->_poll_is_multiple_choice($topic_data['poll_max_options']), 'S_POLL_ACTION' => $viewtopic_url, 'S_FORM_TOKEN' => $this->sitemaker->get_form_key('posting'), 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll'));
     return array('title' => 'POLL', 'content' => $this->ptemplate->render_view('blitze/sitemaker', 'blocks/forum_poll.html', 'forum_poll_block'));
 }
 public static function load_scripts(\blitze\sitemaker\services\util $util)
 {
     $asset_path = $util->asset_path;
     $util->add_assets(array('js' => array('//ajax.googleapis.com/ajax/libs/jqueryui/' . JQUI_VERSION . '/jquery-ui.min.js', 'http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js', $asset_path . 'ext/blitze/sitemaker/components/twig.js/twig.min.js', $asset_path . 'ext/blitze/sitemaker/components/jqueryui-touch-punch/jquery.ui.touch-punch.min.js', $asset_path . 'ext/blitze/sitemaker/components/jquery.populate/jquery.populate.min.js', $asset_path . 'ext/blitze/sitemaker/components/nestedSortable/jquery.ui.nestedSortable.min.js', '@blitze_sitemaker/assets/tree/builder.min.js'), 'css' => array('//ajax.googleapis.com/ajax/libs/jqueryui/' . JQUI_VERSION . '/themes/smoothness/jquery-ui.css', '@blitze_sitemaker/assets/tree/builder.min.css')));
 }
 public function set_assets()
 {
     $asset_path = $this->util->asset_path;
     $this->util->add_assets(array('js' => array('//ajax.googleapis.com/ajax/libs/jqueryui/' . JQUI_VERSION . '/jquery-ui.min.js', '//tinymce.cachefly.net/4.2/tinymce.min.js', $asset_path . 'ext/blitze/sitemaker/components/jqueryui-touch-punch/jquery.ui.touch-punch.min.js', $asset_path . 'ext/blitze/sitemaker/components/twig.js/twig.min.js', 100 => '@blitze_sitemaker/assets/blocks/manager.min.js'), 'css' => array('//ajax.googleapis.com/ajax/libs/jqueryui/' . JQUI_VERSION . '/themes/smoothness/jquery-ui.css', '@blitze_sitemaker/assets/blocks/manager.min.css')));
 }