public function __construct() { global $aidlink, $locale; $_POST['page_id'] = isset($_POST['page_id']) && isnum($_POST['page_id']) ? $_POST['page_id'] : 0; $_GET['status'] = isset($_GET['status']) ? $_GET['status'] : ''; $_GET['action'] = isset($_GET['action']) ? $_GET['action'] : ''; $title = ''; switch ($_GET['action']) { case 'edit': fusion_confirm_exit(); $this->data = self::load_customPage($_GET['cpid']); if (empty($this->data)) { redirect(FUSION_SELF . $aidlink); } opentable($locale['401']); break; case 'delete': self::delete_customPage($_GET['cpid']); break; default: opentable($locale['400']); } self::customPage_selector(); add_breadcrumb(array('link' => ADMIN . 'custom_pages.php' . $aidlink, 'title' => $locale['403'])); $this->data = self::set_customPage($this->data); if (isset($_POST['cancel'])) { redirect(FUSION_SELF . $aidlink); } }
public function display_custom_page_admin() { global $aidlink; $locale = fusion_get_locale("", LOCALE . LOCALESET . "admin/custom_pages.php"); if (isset($_POST['cancel'])) { redirect(FUSION_SELF . $aidlink); } $locale = fusion_get_locale("", LOCALE . LOCALESET . "admin/custom_pages.php"); $_POST['page_id'] = isset($_POST['page_id']) && isnum($_POST['page_id']) ? $_POST['page_id'] : 0; $_GET['status'] = isset($_GET['status']) ? $_GET['status'] : ''; $_GET['action'] = isset($_GET['action']) ? $_GET['action'] : ''; switch ($_GET['action']) { case 'edit': fusion_confirm_exit(); if (!isset($_GET['cpid'])) { redirect(FUSION_SELF . $aidlink); } $this->data = self::load_customPage($_GET['cpid']); if (empty($this->data)) { redirect(FUSION_SELF . $aidlink); } opentable($locale['401']); break; case 'delete': if (!isset($_GET['cpid'])) { redirect(FUSION_SELF . $aidlink); } self::delete_customPage($_GET['cpid']); break; default: opentable($locale['403']); } $this->display_customPage_selector(); $this->data = self::set_customPage($this->data); }
/** * Displays forum mood form */ private function displayMoodForm() { $locale = fusion_get_locale('', FORUM_ADMIN_LOCALE); fusion_confirm_exit(); $this->post_Mood(); $quantum = new QuantumFields(); $groups = fusion_get_groups(); unset($groups[0]); if (!empty($_GET['action'])) { $validMoodID = isset($_GET['mood_id']) && isnum($_GET['mood_id']) && !empty(dbcount('(mood_id)', DB_FORUM_MOODS, "mood_id=" . $_GET['mood_id'])) ? TRUE : FALSE; switch ($_GET['action']) { case 'edit': if ($validMoodID) { $query = "SELECT * FROM " . DB_FORUM_MOODS . " WHERE mood_id='" . intval($_GET['mood_id']) . "'"; $result = dbquery($query); if (dbrows($result) > 0) { $this->data = dbarray($result); } else { redirect(clean_request('', array('ref', 'mood_id'), FALSE)); } } else { redirect(clean_request('', array('ref', 'mood_id'), FALSE)); } break; case 'delete': if ($validMoodID) { addNotice('success', $locale['forum_notice_014']); dbquery("DELETE FROM " . DB_FORUM_MOODS . " WHERE mood_id='" . intval($_GET['mood_id']) . "'"); } else { redirect(clean_request('', array('ref', 'mood_id'), FALSE)); } break; default: redirect(clean_request('', array('ref', 'mood_id'), FALSE)); } } echo openform("mood_form", "POST", FUSION_REQUEST, array('class' => 'm-t-20 m-b-20')) . form_hidden('mood_id', '', $this->data['mood_id']) . $quantum->quantum_multilocale_fields('mood_name', $locale['forum_094'], $this->data['mood_name'], array('required' => TRUE, 'inline' => TRUE, 'placeholder' => $locale['forum_096'])) . $quantum->quantum_multilocale_fields('mood_description', $locale['forum_095'], $this->data['mood_description'], array('required' => TRUE, 'inline' => TRUE, 'placeholder' => $locale['forum_097'], 'ext_tip' => $locale['forum_098'])) . form_text('mood_icon', $locale['forum_099'], $this->data['mood_icon'], array('inline' => TRUE, 'width' => '350px')) . form_checkbox('mood_status', $locale['forum_100'], $this->data['mood_status'], array('options' => array($locale['forum_101'], $locale['forum_102']), 'inline' => TRUE, 'type' => 'radio')) . form_checkbox('mood_notify', $locale['forum_103'], $this->data['mood_notify'], array('options' => $groups, 'inline' => TRUE, 'type' => 'radio')) . form_checkbox('mood_access', $locale['forum_104'], $this->data['mood_access'], array('options' => $groups, 'inline' => TRUE, 'type' => 'radio')) . form_button('save_mood', !empty($this->data['mood_id']) ? $locale['forum_106'] : $locale['forum_105'], $locale['save_changes'], array('class' => 'btn-primary m-r-10')) . form_button('cancel_mood', $locale['cancel'], $locale['cancel']) . closeform(); }
/** * The Panel Editor Form */ public function add_panel_form() { global $locale; fusion_confirm_exit(); if (isset($_POST['panel_preview'])) { $panel_title = form_sanitizer($_POST['panel_name'], "", "panel_name"); if (\defender::safe()) { echo openmodal("cp_preview", $panel_title); if (fusion_get_settings("allow_php_exe")) { ob_start(); eval("?>" . stripslashes($_POST['panel_content']) . "<?php "); $eval = ob_get_contents(); ob_end_clean(); echo $eval; } else { echo "<p>" . nl2br(parse_textarea($_POST['panel_content'])) . "</p>\n"; } echo closemodal(); } $this->data = array("panel_id" => form_sanitizer($_POST['panel_id'], 0, "panel_id"), "panel_name" => form_sanitizer($_POST['panel_name'], "", "panel_name"), "panel_filename" => form_sanitizer($_POST['panel_filename'], "", "panel_filename"), "panel_side" => form_sanitizer($_POST['panel_side'], "", "panel_side"), "panel_content" => form_sanitizer($_POST['panel_content'], "", "panel_content"), "panel_restriction" => form_sanitizer($_POST['panel_restriction'], "", "panel_restriction"), "panel_url_list" => form_sanitizer($_POST['panel_url_list'], "", "panel_url_list"), "panel_display" => form_sanitizer($_POST['panel_display'], "", "panel_display"), "panel_access" => form_sanitizer($_POST['panel_access'], iGUEST, "panel_access"), "panel_languages" => !empty($_POST['panel_languages']) ? form_sanitizer($_POST['panel_languages'], "", "panel_languages") : LANGUAGE); } echo "<div class='m-t-20'>\n"; echo openform('panel_form', 'post', $this->formaction, array('max_tokens' => 1)); echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-8'>\n"; openside(''); echo form_hidden('panel_id', '', $this->data['panel_id']); echo form_text('panel_name', $locale['452'], $this->data['panel_name'], array('inline' => 1, 'required' => 1)); //'error_text'=>$locale['470'] echo form_select('panel_filename', $locale['453'], $this->data['panel_filename'], array('options' => self::get_panelOpts(), 'inline' => 1)); $grid_opts = self::get_panel_grid(); echo form_select('panel_side', $locale['457'], $this->data['panel_side'], array('options' => $grid_opts, 'inline' => TRUE)); closeside(); openside(''); add_to_jquery("\n\t\t" . ($this->data['panel_restriction'] == 3 || $this->data['panel_restriction'] == 2 ? "\$('#panel_url_list-grp').hide();" : '') . "\n\t\t\$('#panel_restriction').bind('change', function(e) {\n\t\t\tif (\$(this).val() == '3' || \$(this).val() == '2') { \$('#panel_url_list-grp').hide(); } else { \$('#panel_url_list-grp').show(); }\n\t\t});\n\t\t"); echo form_select('panel_restriction', $locale['468'], $this->data['panel_restriction'], array('options' => self::get_includeOpts(), 'inline' => 1)); echo "<div id='panel_url_list-grp'>\n"; echo "<div class='text-smaller'></div>\n"; echo form_select('panel_url_list', $locale['462'], $this->data['panel_url_list'], array('options' => self::get_panel_url_list(), 'inline' => 1, 'tags' => 1, 'multiple' => 1, 'width' => '100%')); echo "</div>\n"; echo form_hidden('panel_display', '', $this->data['panel_display']); closeside(); add_to_jquery("\n\t\t" . ($this->data['panel_filename'] > 0 ? "\$('#pgrp').hide();" : "\$('#pgrp').show();") . "\n\t\t\$('#panel_filename').bind('change', function(e) {\n\t\t\tif (\$(this).val() > 0) { \$('#pgrp').hide(); } else { \$('#pgrp').show(); }\n\t\t});\n\t\t"); echo "<div id='pgrp'>\n"; echo form_textarea('panel_content', $locale['455'], $this->data['panel_content'], array('html' => fusion_get_settings("allow_php_exe") ? FALSE : TRUE, 'form_name' => 'panel_form', 'autosize' => 1, 'preview' => fusion_get_settings("allow_php_exe") ? FALSE : TRUE)); echo "</div>\n"; echo "</div>\n<div class='col-xs-12 col-sm-4'>\n"; openside(''); echo form_select('panel_access', $locale['458'], $this->data['panel_access'], array("options" => self::get_accessOpts())); echo form_button('panel_save', $locale['461'], $locale['461'], array('class' => 'btn-primary')); echo form_button('panel_preview', $locale['preview'], $locale['preview'], array('input_id' => 'prev2', 'class' => 'm-l-10 btn-default')); closeside(); openside(''); echo "<label class='label-control m-b-10'>" . $locale['466'] . "</label>\n"; $languages = !empty($this->data['panel_languages']) ? explode('.', $this->data['panel_languages']) : array(); foreach (fusion_get_enabled_languages() as $language => $language_name) { echo form_checkbox('panel_languages[]', $language_name, in_array($language, $languages) ? 1 : 0, array('class' => 'm-b-0', 'value' => $language, "reverse_label" => TRUE, 'input_id' => 'panel_lang-' . $language)); } closeside(); echo "</div>\n"; echo "</div>\n"; echo form_button('panel_save', $locale['461'], $locale['460'], array('class' => 'btn-primary')); echo form_button('panel_preview', $locale['preview'], $locale['preview'], array('class' => 'm-l-10 btn-default')); echo closeform(); echo "</div>\n"; }
/** * Site Links Form */ private function display_sitelinks_form() { $locale = fusion_get_locale(); fusion_confirm_exit(); if (isset($_POST['savelink'])) { $this->data = array("link_id" => form_sanitizer($_POST['link_id'], 0, 'link_id'), "link_cat" => form_sanitizer($_POST['link_cat'], 0, 'link_cat'), "link_name" => form_sanitizer($_POST['link_name'], '', 'link_name'), "link_url" => form_sanitizer($_POST['link_url'], '', 'link_url'), "link_icon" => form_sanitizer($_POST['link_icon'], '', 'link_icon'), "link_language" => form_sanitizer($_POST['link_language'], '', 'link_language'), "link_visibility" => form_sanitizer($_POST['link_visibility'], '', 'link_visibility'), "link_position" => form_sanitizer($_POST['link_position'], '', 'link_position'), "link_order" => form_sanitizer($_POST['link_order'], '', 'link_order'), "link_window" => form_sanitizer(isset($_POST['link_window']) && $_POST['link_window'] == 1 ? 1 : 0, 0, 'link_window')); if ($this->data['link_position'] > 3) { $this->data['link_position'] = form_sanitizer($_POST['link_position_id'], 3, 'link_position_id'); } if (empty($this->data['link_order'])) { $max_order_query = "SELECT MAX(link_order) 'link_order' FROM " . DB_SITE_LINKS . "\n " . (multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "' AND" : "WHERE") . "\n link_cat='" . $this->data['link_cat'] . "'"; $this->data['link_order'] = dbresult(dbquery($max_order_query), 0) + 1; } if (\defender::safe()) { if (!empty($this->data['link_id'])) { dbquery_order(DB_SITE_LINKS, $this->data['link_order'], "link_order", $this->data['link_id'], "link_id", $this->data['link_cat'], "link_cat", multilang_table("SL"), "link_language", "update"); dbquery_insert(DB_SITE_LINKS, $this->data, 'update'); addNotice("success", $locale['SL_0016']); } else { dbquery_order(DB_SITE_LINKS, $this->data['link_order'], "link_order", $this->data['link_id'], "link_id", $this->data['link_cat'], "link_cat", multilang_table("SL"), "link_language", "save"); dbquery_insert(DB_SITE_LINKS, $this->data, 'save'); addNotice("success", $locale['SL_0015']); } redirect(clean_request("link_cat=" . $this->data['link_cat'], array('ref'), FALSE)); } } echo "<div class='m-t-20'>\n"; echo openform('link_administration_frm', 'post', FUSION_REQUEST); echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-8 col-lg-8'>\n"; echo form_hidden('link_id', '', $this->data['link_id']); echo form_textarea('link_name', $locale['SL_0020'], $this->data['link_name'], array('max_length' => 100, 'required' => TRUE, 'error_text' => $locale['SL_0085'], 'form_name' => 'linkform', 'type' => 'bbcode', 'inline' => TRUE)); echo form_text('link_icon', 'Link Icon', $this->data['link_icon'], array('max_length' => 100, 'inline' => TRUE)); echo form_text('link_url', $locale['SL_0021'], $this->data['link_url'], array('required' => TRUE, 'error_text' => $locale['SL_0086'], 'inline' => TRUE)); echo form_text('link_order', $locale['SL_0023'], $this->data['link_order'], array('class' => 'pull-left', 'inline' => TRUE, 'width' => '250px', 'type' => 'number')); // There will be a trick to manipulate the situation here if ($this->data['link_position'] > 3) { $this->data['link_position_id'] = $this->data['link_position']; $this->data['link_position'] = 4; } echo form_select('link_position', $locale['SL_0024'], $this->data['link_position'], array('options' => $this->position_opts, 'inline' => TRUE, 'stacked' => form_text('link_position_id', '', $this->data['link_position_id'], array('required' => true, 'placeholder' => 'ID', 'type' => 'number', 'type' => 'number', 'width' => '150px')))); add_to_jquery("\n checkLinkPosition( " . $this->data['link_position'] . " );\n \$('#link_position').bind('change', function(e) {\n checkLinkPosition( \$(this).val() );\n });\n "); echo "</div>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-4 col-lg-4'>\n"; echo form_select_tree("link_cat", $locale['SL_0029'], $this->data['link_cat'], array('input_id' => 'link_categorys', "parent_value" => $locale['parent'], 'width' => '100%', 'query' => multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "'" : '', 'disable_opts' => $this->data['link_id'], 'hide_disabled' => 1), DB_SITE_LINKS, "link_name", "link_id", "link_cat"); echo form_select('link_language', $locale['global_ML100'], $this->data['link_language'], array('options' => $this->language_opts, 'placeholder' => $locale['choose'], 'width' => '100%')); echo form_select('link_visibility', $locale['SL_0022'], $this->data['link_visibility'], array('options' => self::get_LinkVisibility(), 'placeholder' => $locale['choose'], 'width' => '100%')); echo form_checkbox('link_window', $locale['SL_0028'], $this->data['link_window']); echo "</div>\n"; echo "</div>\n"; echo form_button('savelink', $locale['SL_0040'], $locale['SL_0040'], array('class' => 'btn-primary m-r-10', 'input_id' => 'savelink_2')); echo form_button("cancel", $locale['cancel'], "cancel", array('input_id' => 'cancel2')); echo closeform(); echo "</div>\n"; }
/** * Site Links Form */ public function menu_form() { global $locale, $aidlink; fusion_confirm_exit(); $this->AdminInstance(); if (isset($_POST['savelink'])) { $data = array("link_id" => form_sanitizer($_POST['link_id'], 0, 'link_id'), "link_cat" => form_sanitizer($_POST['link_cat'], 0, 'link_cat'), "link_name" => form_sanitizer($_POST['link_name'], '', 'link_name'), "link_url" => form_sanitizer($_POST['link_url'], '', 'link_url'), "link_icon" => form_sanitizer($_POST['link_icon'], '', 'link_icon'), "link_language" => form_sanitizer($_POST['link_language'], '', 'link_language'), "link_visibility" => form_sanitizer($_POST['link_visibility'], '', 'link_visibility'), "link_position" => form_sanitizer($_POST['link_position'], '', 'link_position'), "link_order" => form_sanitizer($_POST['link_order'], '', 'link_order')); if (!$data['link_order']) { $data['link_order'] = dbresult(dbquery("SELECT MAX(link_order) FROM " . DB_SITE_LINKS . " " . (multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "' AND" : "WHERE") . " link_cat='" . $data['link_cat'] . "'"), 0) + 1; } if (\defender::safe()) { if (self::verify_edit($data['link_id'])) { dbquery_order(DB_SITE_LINKS, $data['link_order'], "link_order", $data['link_id'], "link_id", $data['link_cat'], "link_cat", multilang_table("SL"), "link_language", "update"); dbquery_insert(DB_SITE_LINKS, $data, 'update'); addNotice("success", $locale['SL_0016']); redirect(FUSION_SELF . $aidlink . "&link_cat=" . $data['link_cat']); } else { dbquery_order(DB_SITE_LINKS, $data['link_order'], "link_order", $data['link_id'], "link_id", $data['link_cat'], "link_cat", multilang_table("SL"), "link_language", "save"); dbquery_insert(DB_SITE_LINKS, $data, 'save'); addNotice("success", $locale['SL_0015']); redirect(FUSION_SELF . $aidlink . "&link_cat=" . $data['link_cat']); } } } echo "<div class='m-t-20'>\n"; echo openform('linkform', 'post', $this->form_action, array('max_tokens' => 1)); echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-8 col-lg-8'>\n"; echo form_hidden('link_id', '', $this->data['link_id']); echo form_text('link_name', $locale['SL_0020'], $this->data['link_name'], array('max_length' => 100, 'required' => TRUE, 'error_text' => $locale['SL_0085'], 'inline' => TRUE)); echo form_text('link_icon', 'Link Icon', $this->data['link_icon'], array('max_length' => 100, 'inline' => TRUE)); echo form_text('link_url', $locale['SL_0021'], $this->data['link_url'], array('required' => TRUE, 'error_text' => $locale['SL_0086'], 'inline' => TRUE)); echo form_text('link_order', $locale['SL_0023'], $this->data['link_order'], array('number' => TRUE, 'class' => 'pull-left', 'inline' => TRUE)); echo form_select('link_position', $locale['SL_0024'], $this->data['link_position'], array('options' => $this->position_opts, 'inline' => TRUE)); echo "</div>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-4 col-lg-4'>\n"; openside(''); echo form_select_tree("link_cat", $locale['SL_0029'], $this->data['link_cat'], array('input_id' => 'link_categorys', "parent_value" => $locale['parent'], 'width' => '100%', 'query' => multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "'" : '', 'disable_opts' => $this->data['link_id'], 'hide_disabled' => 1), DB_SITE_LINKS, "link_name", "link_id", "link_cat"); echo form_select('link_language', $locale['global_ML100'], $this->data['link_language'], array('options' => $this->language_opts, 'placeholder' => $locale['choose'], 'width' => '100%')); echo form_select('link_visibility', $locale['SL_0022'], $this->data['link_visibility'], array('options' => self::getVisibility(), 'placeholder' => $locale['choose'], 'width' => '100%')); echo form_checkbox('link_window', $locale['SL_0028'], $this->data['link_window']); closeside(); echo "</div>\n"; echo "</div>\n"; echo form_button('savelink', $locale['SL_0040'], $locale['SL_0040'], array('class' => 'btn-primary')); echo closeform(); echo "</div>\n"; }