function _list_output($assign_list = true) { $sm = vivvo_lite_site::get_instance(); $pm = $sm->get_plugin_manager(); require_once dirname(__FILE__) . '/poll.class.php'; $content_template =& $this->load_template($this->_template_root . 'list.xml'); $content_template->assign('PLUGIN_ROOT', $pm->plugins['poll']['root_dir']); $um = $sm->get_url_manager(); if ($um->isset_param('action') && $um->isset_param('cmd') && $um->get_param('cmd') == 'add' && $sm->action_status === false) { $in_poll_question = $um->get_param_regexp('/^PLUGIN_POLL_/'); $current_poll_question = new vivvo_poll_question(null, $in_poll_question); $content_template->assign('poll', $current_poll_question); } elseif ($um->isset_param('search_pid') && $um->get_param('search_pid') != '') { $poll_list = new vivvo_poll_question_list(); $poll =& $poll_list->get_question($um->get_param('search_pid')); $content_template->assign('poll', $poll); $content_template->assign('answer_list', $poll->answer->list); } else { $poll_list = new vivvo_poll_question_list(); $poll =& $poll_list->get_question_by_status(1); $content_template->assign('poll', $poll); $content_template->assign('answer_list', $poll->answer->list); } if ($um->isset_param('action') && $um->isset_param('cmd') && ($um->get_param('cmd') == 'delete' or $um->get_param('cmd') == 'deactivate' or $um->get_param('cmd') == 'activate')) { $content_template->assign('list_output', strval(1)); } return $content_template; }
/** * Generate box output * Assign box_poll_all template with poll and answers * Sets local language * * @param array $params */ function generate_output($params = '') { $this->set_configuration(); $this->poll_list_all = new vivvo_poll_question_list(); $this->poll = $this->poll_list_all->get_all_question(); $this->set_template($params); $this->_template->assign('poll_list', $this->poll); }