/** * Show the form to edit rules * * @return @e void Outputs to screen */ public function showRules() { /* INI */ $this->request['f'] = intval($this->request['f']); if (!$this->request['f']) { $this->registry->output->showError($this->lang->words['for_noid'], 1134); } $this->DB->build(array('select' => 'id, name, show_rules, rules_title, rules_text', 'from' => 'forums', 'where' => "id=" . $this->request['f'])); $this->DB->execute(); //----------------------------------------- // Make sure we have a legal forum //----------------------------------------- if (!$this->DB->getTotalRows()) { $this->registry->output->showError($this->lang->words['for_noid'], 1135); } $forum = $this->DB->fetch(); /* Load editor stuff */ $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite'); $_editor = new $classToLoad(); $_editor->setAllowHtml(1); $_editor->setAllowSmilies(1); $_editor->setContent($forum['rules_text'], 'rules'); $forum['_editor'] = $_editor->show('body', array('height' => 350, 'autoSaveKey' => "forums-admin-r{$forum['id']}")); /* Form Fields */ $forum['_show_rules'] = $this->registry->output->formDropdown("show_rules", array(array('0', $this->lang->words['for_rulesdont']), array('1', $this->lang->words['for_ruleslink']), array('2', $this->lang->words['for_rulesfull'])), $forum['show_rules']); $forum['_title'] = $this->registry->output->formInput("title", IPSText::stripslashes(str_replace("'", ''', $forum['rules_title']))); /* Output */ $this->registry->output->extra_nav[] = array('', $this->lang->words['frm_rulessetup']); $this->registry->output->html .= $this->html->forumRulesForm($forum['id'], $forum); }
/** * Show the form to edit rules * * @access public * @return void Outputs to screen **/ public function showRules() { /* INI */ $this->request['f'] = intval($this->request['f']); if (!$this->request['f']) { $this->registry->output->showError($this->lang->words['for_noid'], 1134); } $this->DB->build(array('select' => 'id, name, show_rules, rules_title, rules_text', 'from' => 'forums', 'where' => "id=" . $this->request['f'])); $this->DB->execute(); //----------------------------------------- // Make sure we have a legal forum //----------------------------------------- if (!$this->DB->getTotalRows()) { $this->registry->output->showError($this->lang->words['for_noid'], 1135); } $forum = $this->DB->fetch(); //----------------------------------------- // Load and config the std/rte editors //----------------------------------------- IPSText::getTextClass('bbcode')->bypass_badwords = 1; IPSText::getTextClass('bbcode')->parse_smilies = 0; IPSText::getTextClass('bbcode')->parse_html = 1; IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parsing_section = 'rules'; /* Form Fields */ $forum['_show_rules'] = $this->registry->output->formDropdown("show_rules", array(array('0', $this->lang->words['for_rulesdont']), array('1', $this->lang->words['for_ruleslink']), array('2', $this->lang->words['for_rulesfull'])), $forum['show_rules']); $forum['_title'] = $this->registry->output->formInput("title", IPSText::stripslashes(str_replace("'", ''', $forum['rules_title']))); if (IPSText::getTextClass('editor')->method == 'rte') { $forum['rules_text'] = IPSText::getTextClass('bbcode')->convertForRTE($forum['rules_text']); } else { $forum['rules_text'] = IPSText::getTextClass('bbcode')->preEditParse($forum['rules_text']); } $forum['_editor'] = IPSText::getTextClass('editor')->showEditor($forum['rules_text'], 'body'); /* Output */ $this->registry->output->html .= $this->html->forumRulesForm($forum['id'], $forum); }