当前位置: 首页>>代码示例>>PHP>>正文


PHP qa_clicked函数代码示例

本文整理汇总了PHP中qa_clicked函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_clicked函数的具体用法?PHP qa_clicked怎么用?PHP qa_clicked使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了qa_clicked函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: admin_form

 public function admin_form()
 {
     require_once QA_INCLUDE_DIR . 'util/sort.php';
     $saved = false;
     if (qa_clicked('xml_sitemap_save_button')) {
         qa_opt('xml_sitemap_show_questions', (int) qa_post_text('xml_sitemap_show_questions_field'));
         if (!QA_FINAL_EXTERNAL_USERS) {
             qa_opt('xml_sitemap_show_users', (int) qa_post_text('xml_sitemap_show_users_field'));
         }
         if (qa_using_tags()) {
             qa_opt('xml_sitemap_show_tag_qs', (int) qa_post_text('xml_sitemap_show_tag_qs_field'));
         }
         if (qa_using_categories()) {
             qa_opt('xml_sitemap_show_category_qs', (int) qa_post_text('xml_sitemap_show_category_qs_field'));
             qa_opt('xml_sitemap_show_categories', (int) qa_post_text('xml_sitemap_show_categories_field'));
         }
         $saved = true;
     }
     $form = array('ok' => $saved ? 'XML sitemap settings saved' : null, 'fields' => array('questions' => array('label' => 'Include question pages', 'type' => 'checkbox', 'value' => (int) qa_opt('xml_sitemap_show_questions'), 'tags' => 'name="xml_sitemap_show_questions_field"')), 'buttons' => array(array('label' => 'Save Changes', 'tags' => 'name="xml_sitemap_save_button"')));
     if (!QA_FINAL_EXTERNAL_USERS) {
         $form['fields']['users'] = array('label' => 'Include user pages', 'type' => 'checkbox', 'value' => (int) qa_opt('xml_sitemap_show_users'), 'tags' => 'name="xml_sitemap_show_users_field"');
     }
     if (qa_using_tags()) {
         $form['fields']['tagqs'] = array('label' => 'Include question list for each tag', 'type' => 'checkbox', 'value' => (int) qa_opt('xml_sitemap_show_tag_qs'), 'tags' => 'name="xml_sitemap_show_tag_qs_field"');
     }
     if (qa_using_categories()) {
         $form['fields']['categoryqs'] = array('label' => 'Include question list for each category', 'type' => 'checkbox', 'value' => (int) qa_opt('xml_sitemap_show_category_qs'), 'tags' => 'name="xml_sitemap_show_category_qs_field"');
         $form['fields']['categories'] = array('label' => 'Include category browser', 'type' => 'checkbox', 'value' => (int) qa_opt('xml_sitemap_show_categories'), 'tags' => 'name="xml_sitemap_show_categories_field"');
     }
     return $form;
 }
开发者ID:kosmoluna,项目名称:question2answer,代码行数:31,代码来源:qa-xml-sitemap.php

示例2: admin_form

 function admin_form(&$qa_content)
 {
     // process the admin form if admin hit Save-Changes-button
     $ok = null;
     if (qa_clicked('qa_blog_save')) {
         qa_opt('qa_blog_enabled', (bool) qa_post_text('qa_blog_enabled'));
         qa_opt('qa_blog_title', qa_post_text('qa_blog_title'));
         qa_opt('qa_blog_tagline', qa_post_text('qa_blog_tagline'));
         qa_opt('qa_blog_cat_1', qa_post_text('qa_blog_cat_1'));
         qa_opt('qa_blog_cat_2', qa_post_text('qa_blog_cat_2'));
         qa_opt('qa_blog_cat_3', qa_post_text('qa_blog_cat_3'));
         qa_opt('qa_blog_cat_4', qa_post_text('qa_blog_cat_4'));
         qa_opt('qa_blog_cat_5', qa_post_text('qa_blog_cat_5'));
         qa_opt('qa_blog_rules', qa_post_text('qa_blog_rules'));
         qa_opt('qa_blog_content_max', (int) qa_post_text('qa_blog_content_max_field'));
         $ok = qa_lang('qa_blog_lang/blog_save');
     }
     qa_set_display_rules($qa_content, array('field_2' => 'field_1', 'field_3' => 'field_1', 'field_5' => 'field_1', 'field_6' => 'field_1', 'field_7' => 'field_1', 'field_8' => 'field_1', 'field_9' => 'field_1', 'field_10' => 'field_1', 'field_11' => 'field_1'));
     // form fields to display frontend for admin
     $fields = array();
     $fields[] = array('label' => qa_lang('qa_blog_lang/enable_plugin'), 'type' => 'checkbox', 'value' => qa_opt('qa_blog_enabled'), 'tags' => 'name="qa_blog_enabled" id="field_1"');
     $fields[] = array('id' => 'field_2', 'type' => 'input', 'label' => qa_lang('qa_blog_lang/blog_title'), 'value' => qa_opt('qa_blog_title'), 'tags' => 'name="qa_blog_title"');
     $fields[] = array('id' => 'field_3', 'type' => 'textarea', 'label' => qa_lang('qa_blog_lang/blog_tagline'), 'value' => qa_opt('qa_blog_tagline'), 'rows' => 4, 'tags' => 'name="qa_blog_tagline"');
     $fields[] = array('id' => 'field_5', 'type' => 'input', 'label' => qa_lang('qa_blog_lang/cat_1'), 'value' => qa_opt('qa_blog_cat_1'), 'tags' => 'name="qa_blog_cat_1"');
     $fields[] = array('id' => 'field_6', 'type' => 'input', 'label' => qa_lang('qa_blog_lang/cat_2'), 'value' => qa_opt('qa_blog_cat_2'), 'tags' => 'name="qa_blog_cat_2"');
     $fields[] = array('id' => 'field_7', 'type' => 'input', 'label' => qa_lang('qa_blog_lang/cat_3'), 'value' => qa_opt('qa_blog_cat_3'), 'tags' => 'name="qa_blog_cat_3"');
     $fields[] = array('id' => 'field_8', 'type' => 'input', 'label' => qa_lang('qa_blog_lang/cat_4'), 'value' => qa_opt('qa_blog_cat_4'), 'tags' => 'name="qa_blog_cat_4"');
     $fields[] = array('id' => 'field_9', 'type' => 'input', 'label' => qa_lang('qa_blog_lang/cat_5'), 'value' => qa_opt('qa_blog_cat_5'), 'tags' => 'name="qa_blog_cat_5"');
     $fields[] = array('id' => 'field_10', 'type' => 'textarea', 'label' => qa_lang('qa_blog_lang/blog_rules'), 'value' => qa_opt('qa_blog_rules'), 'tags' => 'name="qa_blog_rules"', 'rows' => 4);
     $fields[] = array('id' => 'field_11', 'label' => qa_lang('qa_blog_lang/content_max'), 'suffix' => qa_lang('qa_blog_lang/suffix'), 'type' => 'number', 'value' => (int) qa_opt('qa_blog_content_max'), 'tags' => 'name="qa_blog_content_max_field"');
     return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => 'Save Changes', 'tags' => 'name="qa_blog_save"')));
 }
开发者ID:arjunsuresh,项目名称:qa-blog-post,代码行数:32,代码来源:qa-blog-admin.php

示例3: admin_form

 function admin_form(&$qa_content)
 {
     //	Process form input
     $ok = null;
     if (qa_clicked('prevnav_save_button')) {
         qa_opt('prevnav_plugin_css', qa_post_text('prevnav_plugin_css'));
         qa_opt('prevnav_plugin_widget_only', (bool) qa_post_text('prevnav_plugin_widget_only'));
         qa_opt('prevnav_plugin_widget_title', qa_post_text('prevnav_plugin_widget_title'));
         $ok = qa_lang('admin/options_saved');
     } else {
         if (qa_clicked('prevnav_reset_button')) {
             foreach ($_POST as $i => $v) {
                 $def = $this->option_default($i);
                 if ($def !== null) {
                     qa_opt($i, $def);
                 }
             }
             $ok = qa_lang('admin/options_reset');
         }
     }
     //	Create the form for display
     $fields = array();
     $fields[] = array('type' => 'blank');
     $fields[] = array('label' => 'PrevNav buttons custom css', 'tags' => 'NAME="prevnav_plugin_css"', 'value' => qa_opt('prevnav_plugin_css'), 'type' => 'textarea', 'rows' => 20);
     $fields[] = array('label' => 'Widget Title', 'tags' => 'NAME="prevnav_plugin_widget_title"', 'value' => qa_opt('prevnav_plugin_widget_title'));
     $fields[] = array('type' => 'blank');
     $fields[] = array('type' => 'blank');
     return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="prevnav_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="prevnav_reset_button"')));
 }
开发者ID:arjunsuresh,项目名称:prevnav,代码行数:29,代码来源:qa-prevnav-admin.php

示例4: admin_form

 function admin_form(&$qa_content)
 {
     //	Process form input
     $saved = false;
     if (qa_clicked('event_logger_save_button')) {
         qa_opt('event_logger_to_database', (int) qa_post_text('event_logger_to_database_field'));
         qa_opt('event_logger_to_files', qa_post_text('event_logger_to_files_field'));
         qa_opt('event_logger_directory', qa_post_text('event_logger_directory_field'));
         qa_opt('event_logger_hide_header', !qa_post_text('event_logger_hide_header_field'));
         $saved = true;
         //	Create the database table if database logging was switched on
         if (qa_opt('event_logger_to_database')) {
             require_once QA_INCLUDE_DIR . 'qa-app-users.php';
             require_once QA_INCLUDE_DIR . 'qa-db-maxima.php';
             qa_db_query_sub('CREATE TABLE IF NOT EXISTS ^eventlog (' . 'datetime DATETIME NOT NULL,' . 'ipaddress VARCHAR (15) CHARACTER SET ascii,' . 'userid ' . qa_get_mysql_user_column_type() . ',' . 'handle VARCHAR(' . QA_DB_MAX_HANDLE_LENGTH . '),' . 'cookieid BIGINT UNSIGNED,' . 'event VARCHAR (20) CHARACTER SET ascii NOT NULL,' . 'params VARCHAR (800) NOT NULL,' . 'KEY datetime (datetime),' . 'KEY ipaddress (ipaddress),' . 'KEY userid (userid),' . 'KEY event (event)' . ') ENGINE=MyISAM DEFAULT CHARSET=utf8');
         }
     }
     //	Check the validity of the currently entered directory (if any)
     $directory = qa_opt('event_logger_directory');
     $note = null;
     $error = null;
     if (!strlen($directory)) {
         $note = 'Please specify a directory that is writable by the web server.';
     } elseif (!file_exists($directory)) {
         $error = 'This directory cannot be found. Please enter the full path.';
     } elseif (!is_dir($directory)) {
         $error = 'This is a file. Please enter the full path of a directory.';
     } elseif (!is_writable($directory)) {
         $error = 'This directory is not writable by the web server. Please choose a different directory, use chown/chmod to change permissions, or contact your web hosting company for assistance.';
     }
     //	Create the form for display
     qa_set_display_rules($qa_content, array('event_logger_directory_display' => 'event_logger_to_files_field', 'event_logger_hide_header_display' => 'event_logger_to_files_field'));
     return array('ok' => $saved && !isset($error) ? 'Event log settings saved' : null, 'fields' => array(array('label' => 'Log events to <code>' . QA_MYSQL_TABLE_PREFIX . 'eventlog</code> database table', 'tags' => 'NAME="event_logger_to_database_field"', 'value' => qa_opt('event_logger_to_database'), 'type' => 'checkbox'), array('label' => 'Log events to daily log files', 'tags' => 'NAME="event_logger_to_files_field" ID="event_logger_to_files_field"', 'value' => qa_opt('event_logger_to_files'), 'type' => 'checkbox'), array('id' => 'event_logger_directory_display', 'label' => 'Directory for log files (enter full path):', 'value' => qa_html($directory), 'tags' => 'NAME="event_logger_directory_field"', 'note' => $note, 'error' => $error), array('id' => 'event_logger_hide_header_display', 'label' => 'Include header lines at top of each log file', 'type' => 'checkbox', 'tags' => 'NAME="event_logger_hide_header_field"', 'value' => !qa_opt('event_logger_hide_header'))), 'buttons' => array(array('label' => 'Save Changes', 'tags' => 'NAME="event_logger_save_button"')));
 }
开发者ID:TheProjecter,项目名称:microprobe,代码行数:34,代码来源:qa-event-logger.php

示例5: admin_form

 function admin_form(&$qa_content)
 {
     $saved = false;
     if (qa_clicked(self::SAVE_BUTTON)) {
         qa_opt(self::FACEBOOK_PAGE_URL, qa_post_text(self::FACEBOOK_PAGE_URL));
         // for like box
         qa_opt(self::SHOW_FB_LIKE_BOX, !!qa_post_text(self::SHOW_FB_LIKE_BOX));
         qa_opt(self::LIKE_BOX_COLOR_SCHEME, qa_post_text(self::LIKE_BOX_COLOR_SCHEME));
         qa_opt(self::LIKE_BOX_SHOW_HEADER, qa_post_text(self::LIKE_BOX_SHOW_HEADER));
         qa_opt(self::LIKE_BOX_SHOW_BORDER, qa_post_text(self::LIKE_BOX_SHOW_BORDER));
         qa_opt(self::LIKE_BOX_SHOW_FACES, qa_post_text(self::LIKE_BOX_SHOW_FACES));
         qa_opt(self::LIKE_BOX_SHOW_DATA_STREAM, qa_post_text(self::LIKE_BOX_SHOW_DATA_STREAM));
         qa_opt(self::LIKE_BOX_HEIGHT, qa_post_text(self::LIKE_BOX_HEIGHT));
         qa_opt(self::LIKE_BOX_WIDTH, qa_post_text(self::LIKE_BOX_WIDTH));
         // for modal
         qa_opt(self::SHOW_FB_LIKE_MODAL, !!qa_post_text(self::SHOW_FB_LIKE_MODAL));
         qa_opt(self::MODAL_COLOR_SCHEME, qa_post_text(self::MODAL_COLOR_SCHEME));
         qa_opt(self::MODAL_SHOW_HEADER, qa_post_text(self::MODAL_SHOW_HEADER));
         qa_opt(self::MODAL_SHOW_BORDER, qa_post_text(self::MODAL_SHOW_BORDER));
         qa_opt(self::MODAL_SHOW_FACES, qa_post_text(self::MODAL_SHOW_FACES));
         qa_opt(self::MODAL_SHOW_DATA_STREAM, qa_post_text(self::MODAL_SHOW_DATA_STREAM));
         qa_opt(self::MODAL_HEIGHT, qa_post_text(self::MODAL_HEIGHT));
         qa_opt(self::MODAL_WIDTH, qa_post_text(self::MODAL_WIDTH));
         qa_opt(self::MODAL_COOKIE_EXPIRE, qa_post_text(self::MODAL_COOKIE_EXPIRE));
         qa_opt(self::MODAL_HEADER_MAIN_TEXT, qa_post_text(self::MODAL_HEADER_MAIN_TEXT));
         qa_opt(self::MODAL_FOOTER_TEXT, qa_post_text(self::MODAL_FOOTER_TEXT));
         qa_opt(self::MODAL_USE_CSS_FROM_THEME, !!qa_post_text(self::MODAL_USE_CSS_FROM_THEME));
         qa_opt(self::MODAL_COSTUM_CSS, qa_post_text(self::MODAL_COSTUM_CSS));
         qa_opt(self::MODAL_DISPLAY_EVERY_TIME, !!qa_post_text(self::MODAL_DISPLAY_EVERY_TIME));
         qa_opt(self::MODAL_DELAY, (int) qa_post_text(self::MODAL_DELAY));
         $saved = true;
     }
     qa_set_display_rules($qa_content, array(self::LIKE_BOX_COLOR_SCHEME => self::SHOW_FB_LIKE_BOX, self::LIKE_BOX_SHOW_HEADER => self::SHOW_FB_LIKE_BOX, self::LIKE_BOX_SHOW_BORDER => self::SHOW_FB_LIKE_BOX, self::LIKE_BOX_SHOW_FACES => self::SHOW_FB_LIKE_BOX, self::LIKE_BOX_SHOW_DATA_STREAM => self::SHOW_FB_LIKE_BOX, self::LIKE_BOX_HEIGHT => self::SHOW_FB_LIKE_BOX, self::LIKE_BOX_WIDTH => self::SHOW_FB_LIKE_BOX, self::MODAL_COLOR_SCHEME => self::SHOW_FB_LIKE_MODAL, self::MODAL_SHOW_HEADER => self::SHOW_FB_LIKE_MODAL, self::MODAL_SHOW_BORDER => self::SHOW_FB_LIKE_MODAL, self::MODAL_SHOW_FACES => self::SHOW_FB_LIKE_MODAL, self::MODAL_SHOW_DATA_STREAM => self::SHOW_FB_LIKE_MODAL, self::MODAL_HEIGHT => self::SHOW_FB_LIKE_MODAL, self::MODAL_WIDTH => self::SHOW_FB_LIKE_MODAL, self::MODAL_COOKIE_EXPIRE => self::SHOW_FB_LIKE_MODAL, self::MODAL_HEADER_MAIN_TEXT => self::SHOW_FB_LIKE_MODAL, self::MODAL_FOOTER_TEXT => self::SHOW_FB_LIKE_MODAL, self::MODAL_USE_CSS_FROM_THEME => self::SHOW_FB_LIKE_MODAL, self::MODAL_COSTUM_CSS => self::SHOW_FB_LIKE_MODAL, self::MODAL_DISPLAY_EVERY_TIME => self::SHOW_FB_LIKE_MODAL, self::MODAL_DELAY => self::SHOW_FB_LIKE_MODAL));
     return array('ok' => $saved ? qa_lang('flb_like_box/settings_saved') : null, 'fields' => array(self::FACEBOOK_PAGE_URL => array('label' => qa_lang('flb_like_box/ur_fb_page_url'), 'type' => 'text', 'tags' => 'name="' . self::FACEBOOK_PAGE_URL . '"', 'value' => qa_opt(self::FACEBOOK_PAGE_URL), 'note' => qa_lang('flb_like_box/ur_fb_page_url_note')), self::SHOW_FB_LIKE_BOX => array('label' => qa_lang('flb_like_box/b_show_fb_like_box'), 'tags' => 'name="' . self::SHOW_FB_LIKE_BOX . '" id="' . self::SHOW_FB_LIKE_BOX . '"', 'value' => qa_opt(self::SHOW_FB_LIKE_BOX), 'type' => 'checkbox'), self::LIKE_BOX_COLOR_SCHEME => array('id' => self::LIKE_BOX_COLOR_SCHEME, 'label' => qa_lang('flb_like_box/b_colorscheme_label'), 'type' => 'select', 'tags' => 'name="' . self::LIKE_BOX_COLOR_SCHEME . '"', 'value' => qa_opt(self::LIKE_BOX_COLOR_SCHEME), 'options' => array('light' => 'light', 'dark' => 'dark')), self::LIKE_BOX_SHOW_HEADER => array('id' => self::LIKE_BOX_SHOW_HEADER, 'label' => qa_lang('flb_like_box/b_box_header_label'), 'type' => 'select', 'tags' => 'name="' . self::LIKE_BOX_SHOW_HEADER . '"', 'value' => qa_opt(self::LIKE_BOX_SHOW_HEADER), 'options' => array('false' => 'false', 'true' => 'true')), self::LIKE_BOX_SHOW_BORDER => array('id' => self::LIKE_BOX_SHOW_BORDER, 'label' => qa_lang('flb_like_box/b_show_border_label'), 'type' => 'select', 'tags' => 'name="' . self::LIKE_BOX_SHOW_BORDER . '"', 'value' => qa_opt(self::LIKE_BOX_SHOW_BORDER), 'options' => array('false' => 'false', 'true' => 'true')), self::LIKE_BOX_SHOW_FACES => array('id' => self::LIKE_BOX_SHOW_FACES, 'label' => qa_lang('flb_like_box/b_show_faces_label'), 'type' => 'select', 'tags' => 'name="' . self::LIKE_BOX_SHOW_FACES . '"', 'value' => qa_opt(self::LIKE_BOX_SHOW_FACES), 'options' => array('true' => 'true', 'false' => 'false')), self::LIKE_BOX_SHOW_DATA_STREAM => array('id' => self::LIKE_BOX_SHOW_DATA_STREAM, 'label' => qa_lang('flb_like_box/b_show_stream_label'), 'type' => 'select', 'tags' => 'name="' . self::LIKE_BOX_SHOW_DATA_STREAM . '"', 'value' => qa_opt(self::LIKE_BOX_SHOW_DATA_STREAM), 'options' => array('false' => 'false', 'true' => 'true')), self::LIKE_BOX_HEIGHT => array('id' => self::LIKE_BOX_HEIGHT, 'label' => qa_lang('flb_like_box/b_like_box_height_label'), 'type' => 'text', 'tags' => 'name="' . self::LIKE_BOX_HEIGHT . '"', 'value' => qa_opt(self::LIKE_BOX_HEIGHT)), self::LIKE_BOX_WIDTH => array('id' => self::LIKE_BOX_WIDTH, 'label' => qa_lang('flb_like_box/b_like_box_width_label'), 'type' => 'text', 'tags' => 'name="' . self::LIKE_BOX_WIDTH . '"', 'value' => !!qa_opt(self::LIKE_BOX_WIDTH) ? qa_opt(self::LIKE_BOX_WIDTH) : 200), self::SHOW_FB_LIKE_MODAL => array('label' => qa_lang('flb_like_box/m_show_fb_like_modal'), 'tags' => 'name="' . self::SHOW_FB_LIKE_MODAL . '" id="' . self::SHOW_FB_LIKE_MODAL . '"', 'value' => qa_opt(self::SHOW_FB_LIKE_MODAL), 'type' => 'checkbox'), self::MODAL_USE_CSS_FROM_THEME => array('id' => self::MODAL_USE_CSS_FROM_THEME, 'label' => qa_lang('flb_like_box/m_use_css_from_theme_file'), 'tags' => 'name="' . self::MODAL_USE_CSS_FROM_THEME . '"', 'value' => qa_opt(self::MODAL_USE_CSS_FROM_THEME), 'type' => 'checkbox'), self::MODAL_DISPLAY_EVERY_TIME => array('id' => self::MODAL_DISPLAY_EVERY_TIME, 'label' => qa_lang('flb_like_box/m_display_on_every_load'), 'tags' => 'name="' . self::MODAL_DISPLAY_EVERY_TIME . '"', 'value' => qa_opt(self::MODAL_DISPLAY_EVERY_TIME), 'type' => 'checkbox'), self::MODAL_COLOR_SCHEME => array('id' => self::MODAL_COLOR_SCHEME, 'label' => qa_lang('flb_like_box/m_colorscheme_label'), 'type' => 'select', 'tags' => 'name="' . self::MODAL_COLOR_SCHEME . '"', 'value' => qa_opt(self::MODAL_COLOR_SCHEME), 'options' => array('light' => 'light', 'dark' => 'dark')), self::MODAL_SHOW_HEADER => array('id' => self::MODAL_SHOW_HEADER, 'label' => qa_lang('flb_like_box/m_box_header_label'), 'type' => 'select', 'tags' => 'name="' . self::MODAL_SHOW_HEADER . '"', 'value' => qa_opt(self::MODAL_SHOW_HEADER), 'options' => array('false' => 'false', 'true' => 'true')), self::MODAL_SHOW_BORDER => array('id' => self::MODAL_SHOW_BORDER, 'label' => qa_lang('flb_like_box/m_show_border_label'), 'type' => 'select', 'tags' => 'name="' . self::MODAL_SHOW_BORDER . '"', 'value' => qa_opt(self::MODAL_SHOW_BORDER), 'options' => array('false' => 'false', 'true' => 'true')), self::MODAL_SHOW_FACES => array('id' => self::MODAL_SHOW_FACES, 'label' => qa_lang('flb_like_box/m_show_faces_label'), 'type' => 'select', 'tags' => 'name="' . self::MODAL_SHOW_FACES . '"', 'value' => qa_opt(self::MODAL_SHOW_FACES), 'options' => array('true' => 'true', 'false' => 'false')), self::MODAL_SHOW_DATA_STREAM => array('id' => self::MODAL_SHOW_DATA_STREAM, 'label' => qa_lang('flb_like_box/m_show_stream_label'), 'type' => 'select', 'tags' => 'name="' . self::MODAL_SHOW_DATA_STREAM . '"', 'value' => qa_opt(self::MODAL_SHOW_DATA_STREAM), 'options' => array('false' => 'false', 'true' => 'true')), self::MODAL_HEIGHT => array('id' => self::MODAL_HEIGHT, 'label' => qa_lang('flb_like_box/m_like_modal_height_label'), 'type' => 'text', 'tags' => 'name="' . self::MODAL_HEIGHT . '"', 'value' => qa_opt(self::MODAL_HEIGHT)), self::MODAL_WIDTH => array('id' => self::MODAL_WIDTH, 'label' => qa_lang('flb_like_box/m_like_modal_width_label'), 'type' => 'text', 'tags' => 'name="' . self::MODAL_WIDTH . '"', 'value' => qa_opt(self::MODAL_WIDTH)), self::MODAL_DELAY => array('id' => self::MODAL_DELAY, 'label' => qa_lang('flb_like_box/m_like_modal_delay'), 'type' => 'text', 'tags' => 'name="' . self::MODAL_DELAY . '"', 'value' => qa_opt(self::MODAL_DELAY), 'note' => qa_lang('flb_like_box/m_like_modal_delay_note')), self::MODAL_COOKIE_EXPIRE => array('id' => self::MODAL_COOKIE_EXPIRE, 'label' => qa_lang('flb_like_box/m_like_modal_cookie_expire'), 'type' => 'text', 'tags' => 'name="' . self::MODAL_COOKIE_EXPIRE . '"', 'value' => qa_opt(self::MODAL_COOKIE_EXPIRE), 'note' => qa_lang('flb_like_box/m_like_modal_cookie_expire_note')), self::MODAL_HEADER_MAIN_TEXT => array('id' => self::MODAL_HEADER_MAIN_TEXT, 'label' => qa_lang('flb_like_box/m_pop_up_header_text'), 'type' => 'textarea', 'rows' => 4, 'tags' => 'name="' . self::MODAL_HEADER_MAIN_TEXT . '"', 'value' => qa_opt(self::MODAL_HEADER_MAIN_TEXT)), self::MODAL_FOOTER_TEXT => array('id' => self::MODAL_FOOTER_TEXT, 'label' => qa_lang('flb_like_box/m_pop_up_footer_text'), 'type' => 'textarea', 'rows' => 4, 'tags' => 'name="' . self::MODAL_FOOTER_TEXT . '"', 'value' => qa_opt(self::MODAL_FOOTER_TEXT)), self::MODAL_COSTUM_CSS => array('id' => self::MODAL_COSTUM_CSS, 'label' => qa_lang('flb_like_box/m_costum_css'), 'type' => 'textarea', 'rows' => 4, 'tags' => 'name="' . self::MODAL_COSTUM_CSS . '"', 'value' => qa_opt(self::MODAL_COSTUM_CSS), 'note' => qa_lang_html('flb_like_box/m_costum_css_note'))), 'buttons' => array(array('label' => qa_lang('flb_like_box/save_changes'), 'tags' => 'name="' . self::SAVE_BUTTON . '"')));
 }
开发者ID:Amirdzvb,项目名称:q2a-facebook-like-box,代码行数:35,代码来源:qa-facebook-like-box-admin.php

示例6: admin_form

 function admin_form(&$qa_content)
 {
     //	Process form input
     $ok = null;
     if (qa_clicked('adchat_save_button')) {
         qa_opt('adchat_plugin_css', qa_post_text('adchat_plugin_css'));
         if (qa_post_text('adchat-expand-categories') == 1) {
             qa_opt('adchat-expand-categories', "1");
         } else {
             qa_opt('adchat-expand-categories', "0");
         }
         $ok = qa_lang('admin/options_saved');
     } else {
         if (qa_clicked('adchat_reset_button')) {
             foreach ($_POST as $i => $v) {
                 $def = $this->option_default($i);
                 if ($def !== null) {
                     qa_opt($i, $def);
                 }
             }
             $ok = qa_lang('admin/options_reset');
         }
     }
     //	Create the form for display
     $fields = array();
     $fields[] = array('type' => 'blank');
     $fields[] = array('label' => 'Adchat custom css', 'tags' => 'NAME="adchat_plugin_css"', 'value' => qa_opt('adchat_plugin_css'), 'type' => 'textarea', 'rows' => 20);
     $fields[] = array('label' => 'Make all categories into chat room', 'note' => 'Otherwise only top level categories are made to chat room', 'tags' => 'NAME="adchat-expand-categories"', 'value' => qa_opt('adchat-expand-categories'), 'type' => 'checkbox');
     return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="adchat_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="adchat_reset_button"')));
 }
开发者ID:arjunsuresh,项目名称:chat,代码行数:30,代码来源:qa-adchat-admin.php

示例7: admin_form

 function admin_form(&$qa_content)
 {
     // process config change
     $saved_msg = '';
     if (qa_clicked('tag_synonyms_save_button')) {
         qa_opt('tag_synonyms', trim(qa_post_text('tag_synonyms_text')));
         qa_opt('tag_synonyms_prevent', (int) qa_post_text('tag_synonyms_prevent'));
         qa_opt('tag_synonyms_rep', (int) qa_post_text('tag_synonyms_rep'));
         $saved_msg = 'Tag Synonyms settings saved';
         // convert all old tags based on synonyms
         if (qa_post_text('tag_synonyms_convert')) {
             $synonyms = $this->_synonyms_to_array(qa_opt('tag_synonyms'));
             $edited = 0;
             qa_suspend_event_reports(true);
             // avoid infinite loop
             foreach ($synonyms as $syn) {
                 list($questions, $qcount) = qa_db_select_with_pending(qa_db_tag_recent_qs_selectspec(null, $syn['from'], 0, false, 500), qa_db_tag_count_qs_selectspec($syn['from']));
                 foreach ($questions as $q) {
                     $oldtags = qa_tagstring_to_tags($q['tags']);
                     $newtags = $this->_convert_tags($oldtags, $synonyms);
                     qa_post_set_content($q['postid'], null, null, null, $newtags);
                     $edited++;
                 }
             }
             qa_suspend_event_reports(false);
             $saved_msg .= ' (and ' . $edited . ' tags edited)';
         }
     }
     // set fields to show/hide when checkbox is clicked
     qa_set_display_rules($qa_content, array('tag_synonyms_rep' => 'tag_synonyms_prevent'));
     return array('ok' => $saved_msg, 'fields' => array(array('label' => 'Tag Synonyms', 'tags' => 'name="tag_synonyms_text" id="tag_synonyms_text"', 'value' => qa_opt('tag_synonyms'), 'type' => 'textarea', 'rows' => 20, 'note' => 'Put each pair of synonyms on a new line. <code>q2a,question2answer</code> means that a tag of <code>q2a</code> will be replaced by <code>question2answer</code>, while <code>help</code> on its own means that tag will be removed.'), array('label' => 'Also convert existing tags using above rules', 'tags' => 'name="tag_synonyms_convert" id="tag_synonyms_convert"', 'value' => '', 'type' => 'checkbox'), array('type' => 'blank'), array('label' => 'Prevent new users from creating new tags', 'tags' => 'name="tag_synonyms_prevent" id="tag_synonyms_prevent"', 'value' => qa_opt('tag_synonyms_prevent'), 'type' => 'checkbox'), array('id' => 'tag_synonyms_rep', 'label' => 'Minimum reputation to create new tags', 'value' => qa_opt('tag_synonyms_rep'), 'tags' => 'name="tag_synonyms_rep"', 'type' => 'number')), 'buttons' => array(array('label' => 'Save Changes', 'tags' => 'name="tag_synonyms_save_button"')));
 }
开发者ID:NoahY,项目名称:Q2A-Tag-Synonyms,代码行数:32,代码来源:qa-tag-synonyms.php

示例8: process_request

 function process_request($request)
 {
     // double check we are admin
     if (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
         return;
     }
     if (qa_clicked('docancel')) {
         qa_redirect('admin/plugins');
     }
     $qa_content = qa_content_prepare();
     $qa_content['title'] = 'Widget Anywhere';
     $qa_content['custom'] = '<p><a href="' . qa_path('admin/plugins') . '#' . qa_html($this->anchor) . '">&laquo; back to plugin options</a></p>';
     $saved_msg = null;
     $editid = qa_get('editid');
     if (qa_post_text('dodelete')) {
         $this->delete_widget();
         qa_redirect('admin/plugins');
     } else {
         if (qa_clicked('save_button')) {
             // save widget
             $widget = $this->save_widget();
             $saved_msg = 'Widget saved.';
         } else {
             if (empty($editid)) {
                 // display blank form
                 $widget = array('id' => 0, 'title' => '', 'pages' => '', 'position' => '', 'ordering' => 1, 'content' => '');
             } else {
                 // load specified widget
                 $sql = 'SELECT * FROM ^' . $this->pluginkey . ' WHERE id=#';
                 $result = qa_db_query_sub($sql, $editid);
                 $widget = qa_db_read_one_assoc($result);
             }
         }
     }
     $sel_position = empty($widget['position']) ? null : @$this->positionlangs[$widget['position']];
     // set up page (template) list
     $widget_pages = explode(',', $widget['pages']);
     $sel_pages = array();
     $custom_pages = array();
     foreach ($widget_pages as $page) {
         if (strpos($page, 'custom:') === 0) {
             $custom_pages[] = substr($page, 7);
         } else {
             $sel_pages[] = $page;
         }
     }
     // $chkd = in_array('all', $sel_pages) ? 'checked' : '';
     // $pages_html = '<label><input type="checkbox" name="wpages_all" ' . $chkd . '> ' . qa_lang_html('admin/widget_all_pages') . '</label><br><br>';
     $pages_html = '';
     foreach ($this->templatelangkeys as $tmpl => $langkey) {
         $chkd = in_array($tmpl, $sel_pages) ? 'checked' : '';
         $pages_html .= '<label><input type="checkbox" name="wpages_' . $tmpl . '" ' . $chkd . '> ' . qa_lang_html($langkey) . '</label><br>';
     }
     $qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'ok' => $saved_msg, 'fields' => array('title' => array('label' => 'Title', 'tags' => 'NAME="wtitle"', 'value' => qa_html($widget['title'])), 'position' => array('type' => 'select', 'label' => 'Position', 'tags' => 'NAME="wposition"', 'options' => $this->positionlangs, 'value' => $sel_position), 'all_pages' => array('type' => 'checkbox', 'id' => 'tb_pages_all', 'label' => qa_lang_html('admin/widget_all_pages'), 'tags' => 'NAME="wpages_all" ID="wpages_all"', 'value' => in_array('all', $sel_pages)), 'pages' => array('type' => 'custom', 'id' => 'tb_pages_list', 'label' => qa_lang_html('admin/widget_pages_explanation'), 'html' => $pages_html), 'show_custom_pages' => array('type' => 'checkbox', 'id' => 'tb_show_custom_pages', 'label' => 'Show on custom page(s)', 'tags' => 'NAME="cb_custom_pages" ID="cb_custom_pages"', 'value' => count($custom_pages) > 0), 'custom_pages' => array('id' => 'tb_custom_pages', 'label' => 'Page slugs', 'tags' => 'NAME="wpages_custom"', 'value' => qa_html(implode(',', $custom_pages)), 'note' => 'Separate multiple page slugs (URL fragments) with commas, e.g. <code>custom-page,other-page</code>'), 'ordering' => array('type' => 'number', 'label' => 'Order', 'tags' => 'NAME="wordering"', 'value' => qa_html($widget['ordering'])), 'content' => array('type' => 'textarea', 'label' => 'Content (HTML)', 'tags' => 'NAME="wcontent"', 'value' => qa_html($widget['content']), 'rows' => 12)), 'hidden' => array('wid' => $widget['id']), 'buttons' => array('save' => array('tags' => 'NAME="save_button"', 'label' => 'Save widget', 'value' => '1'), 'cancel' => array('tags' => 'NAME="docancel"', 'label' => qa_lang_html('main/cancel_button'))));
     if ($widget['id'] > 0) {
         $qa_content['form']['fields']['delete'] = array('tags' => 'NAME="dodelete"', 'label' => 'Delete widget', 'value' => 0, 'type' => 'checkbox');
     }
     qa_set_display_rules($qa_content, array('tb_pages_list' => '!wpages_all', 'tb_show_custom_pages' => '!wpages_all', 'tb_custom_pages' => 'cb_custom_pages && !wpages_all'));
     return $qa_content;
 }
开发者ID:siddiquinoor,项目名称:q2a-widget-anywhere,代码行数:60,代码来源:qa-widget-anywhere.php

示例9: admin_form

 function admin_form(&$qa_content)
 {
     // process the admin form if admin hits Save-Changes-button
     $ok = null;
     if (qa_clicked('q2apro_popularqu_save')) {
         qa_opt('q2apro_popularqu_enabled', (bool) qa_post_text('q2apro_popularqu_enabled'));
         // empty or 1
         qa_opt('q2apro_popularqu_maxqu', (int) qa_post_text('q2apro_popularqu_maxqu'));
         qa_opt('q2apro_popularqu_lastdays', (int) qa_post_text('q2apro_popularqu_lastdays'));
         qa_opt('q2apro_popularqu_checkhours', (int) qa_post_text('q2apro_popularqu_checkhours'));
         qa_opt('q2apro_popularqu_answercount', (bool) qa_post_text('q2apro_popularqu_answercount'));
         $ok = qa_lang('admin/options_saved');
         // in case the options have been changed, update the widget
         q2apro_save_most_viewed_questions();
     }
     // form fields to display frontend for admin
     $fields = array();
     $fields[] = array('type' => 'checkbox', 'label' => qa_lang('q2apro_popularqu_lang/enable_plugin'), 'tags' => 'name="q2apro_popularqu_enabled"', 'value' => qa_opt('q2apro_popularqu_enabled'));
     $fields[] = array('type' => 'input', 'label' => qa_lang('q2apro_popularqu_lang/admin_maxqu'), 'tags' => 'name="q2apro_popularqu_maxqu"', 'value' => qa_opt('q2apro_popularqu_maxqu'));
     $fields[] = array('type' => 'checkbox', 'label' => qa_lang('q2apro_popularqu_lang/admin_answercount'), 'tags' => 'name="q2apro_popularqu_answercount"', 'value' => qa_opt('q2apro_popularqu_answercount'));
     $fields[] = array('type' => 'input', 'label' => qa_lang('q2apro_popularqu_lang/admin_lastdays'), 'tags' => 'name="q2apro_popularqu_lastdays"', 'value' => qa_opt('q2apro_popularqu_lastdays'));
     $fields[] = array('type' => 'input', 'label' => qa_lang('q2apro_popularqu_lang/admin_checkhours'), 'tags' => 'name="q2apro_popularqu_checkhours"', 'value' => qa_opt('q2apro_popularqu_checkhours'));
     $fields[] = array('type' => 'static', 'note' => qa_lang('q2apro_popularqu_lang/admin_lastcache') . ' ' . date('Y-m-d H:i:s', (double) qa_opt('q2apro_popularqu_checktime')));
     $fields[] = array('type' => 'static', 'note' => qa_lang('q2apro_popularqu_lang/admin_remember') . ' <a href="' . qa_path('admin/layout') . '">/admin/layout</a>');
     $fields[] = array('type' => 'static', 'note' => '<span style="font-size:75%;color:#789;">' . strtr(qa_lang('q2apro_popularqu_lang/contact'), array('^1' => '<a target="_blank" href="http://www.q2apro.com/forum/">', '^2' => '</a>')) . '</span>');
     return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang('main/save_button'), 'tags' => 'name="q2apro_popularqu_save"')));
 }
开发者ID:q2apro,项目名称:q2apro-popular-questions-widget,代码行数:27,代码来源:q2apro-popular-questions-admin.php

示例10: theme_switch_form

 function theme_switch_form()
 {
     // displays signature form in user profile
     global $qa_request;
     $handle = preg_replace('/^[^\\/]+\\/([^\\/]+).*/', "\$1", $qa_request);
     $userid = $this->getuserfromhandle($handle);
     if (!$userid) {
         return;
     }
     if (qa_get_logged_in_handle() && qa_get_logged_in_handle() == $handle) {
         if (qa_clicked('theme_switch_save')) {
             qa_db_query_sub('INSERT INTO ^usermeta (user_id,meta_key,meta_value) VALUES (#,$,$) ON DUPLICATE KEY UPDATE meta_value=$', $userid, 'custom_theme', qa_post_text('theme_choice'), qa_post_text('theme_choice'));
             qa_redirect($this->request, array('ok' => qa_lang_html('admin/options_saved')));
         } else {
             if (qa_clicked('theme_switch_user_reset')) {
                 qa_db_query_sub('DELETE FROM ^usermeta WHERE user_id=# AND meta_key=$', $userid, 'custom_theme');
                 qa_redirect($this->request, array('ok' => qa_lang_html('admin/options_reset')));
             }
         }
         require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
         $ok = qa_get('ok') ? qa_get('ok') : null;
         $theme_choice = qa_db_read_one_value(qa_db_query_sub('SELECT meta_value FROM ^usermeta WHERE user_id=# AND meta_key=$', $userid, 'custom_theme'), true);
         $themes = qa_admin_theme_options();
         $fields['themes'] = array('label' => qa_opt('theme_switch_text'), 'tags' => 'NAME="theme_choice"', 'type' => 'select', 'options' => qa_admin_theme_options(), 'value' => @$themes[$theme_choice]);
         $form = array('ok' => $ok && !isset($error) ? $ok : null, 'style' => 'tall', 'title' => '<a name="theme_text"></a>' . qa_opt('theme_switch_title'), 'tags' => 'action="' . qa_self_html() . '#theme_text" method="POST"', 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="theme_switch_user_reset"'), array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="theme_switch_save"')));
         return $form;
     }
 }
开发者ID:NoahY,项目名称:q2a-theme-switcher,代码行数:28,代码来源:qa-theme-layer.php

示例11: admin_form

 function admin_form(&$qa_content)
 {
     $ok = null;
     if (qa_clicked('short_url_save_button')) {
         qa_opt('short_url_content_on', (bool) qa_post_text('short_url_content_on'));
         qa_opt('short_url_bitly_username', (string) qa_post_text('short_url_bitly_username'));
         qa_opt('short_url_bitly_api_key', (string) qa_post_text('short_url_bitly_api_key'));
         $ok = qa_lang('admin/options_saved');
     } else {
         if (qa_clicked('short_url_reset_button')) {
             foreach ($_POST as $i => $v) {
                 $def = $this->option_default($i);
                 if ($def !== null) {
                     qa_opt($i, $def);
                 }
             }
             $ok = qa_lang('admin/options_reset');
         }
     }
     $fields = array();
     $ready = strlen(qa_opt('short_url_bitly_username')) && strlen(qa_opt('short_url_bitly_api_key'));
     if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
         $fields[] = array('label' => 'You cannot enable when in localhost', 'tags' => 'NAME="short_url_content_on"', 'value' => qa_opt('short_url_content_on'), 'type' => 'checkbox', 'disabled' => 'disabled');
     } else {
         $fields[] = array('label' => 'Enable Short Url', 'tags' => 'NAME="short_url_content_on"', 'value' => qa_opt('short_url_content_on'), 'type' => 'checkbox');
     }
     $fields[] = array('label' => 'Your Bitly username', 'tags' => 'NAME="short_url_bitly_username"', 'value' => qa_opt('short_url_bitly_username'), 'type' => 'string');
     $fields[] = array('label' => 'Your Bitly api key', 'tags' => 'NAME="short_url_bitly_api_key"', 'value' => qa_opt('short_url_bitly_api_key'), 'type' => 'string', 'error' => $ready ? null : 'You can find your api key <a href="https://bitly.com/a/your_api_key">here</a>');
     return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="short_url_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="short_url_reset_button"')));
 }
开发者ID:roine,项目名称:q2a-short-url-with-bitly,代码行数:30,代码来源:qa-short-url-admin.php

示例12: admin_form

    function admin_form(&$qa_content)
    {
        // Process form input
        $ok = null;
        if (qa_clicked('cp_save')) {
            // Save
            qa_db_query_sub('CREATE TABLE IF NOT EXISTS ^postmeta (
					meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
					post_id bigint(20) unsigned NOT NULL,
					meta_key varchar(255) DEFAULT \'\',
					meta_value longtext,
					PRIMARY KEY (meta_id),
					KEY post_id (post_id),
					KEY meta_key (meta_key)
				) ENGINE=MyISAM  DEFAULT CHARSET=utf8');
            qa_opt('cp_enable', (bool) qa_post_text('cp_enable'));
            $ok = qa_lang('admin/options_saved');
        } else {
            if (qa_clicked('cp_reset')) {
                // Reset
                foreach ($_POST as $i => $v) {
                    $def = $this->option_default($i);
                    if ($def !== null) {
                        qa_opt($i, $def);
                    }
                }
                qa_opt('cp_enable', true);
                $ok = qa_lang('admin/options_reset');
            }
        }
        // Create the form for display
        $fields = array();
        $fields[] = array('label' => qa_lang('cp/enable_community_posts'), 'tags' => 'NAME="cp_enable"', 'value' => qa_opt('cp_enable'), 'type' => 'checkbox');
        return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="cp_save"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="cp_reset"')));
    }
开发者ID:BrunoVandekerkhove,项目名称:q2a-community-posts,代码行数:35,代码来源:qa-cp-admin.php

示例13: admin_form

 public function admin_form(&$qa_content)
 {
     //	Process form input
     $saved = false;
     if (qa_clicked('event_logger_save_button')) {
         qa_opt('event_logger_to_database', (int) qa_post_text('event_logger_to_database_field'));
         qa_opt('event_logger_to_files', qa_post_text('event_logger_to_files_field'));
         qa_opt('event_logger_directory', qa_post_text('event_logger_directory_field'));
         qa_opt('event_logger_hide_header', !qa_post_text('event_logger_hide_header_field'));
         $saved = true;
     }
     //	Check the validity of the currently entered directory (if any)
     $directory = qa_opt('event_logger_directory');
     $note = null;
     $error = null;
     if (!strlen($directory)) {
         $note = 'Please specify a directory that is writable by the web server.';
     } elseif (!file_exists($directory)) {
         $error = 'This directory cannot be found. Please enter the full path.';
     } elseif (!is_dir($directory)) {
         $error = 'This is a file. Please enter the full path of a directory.';
     } elseif (!is_writable($directory)) {
         $error = 'This directory is not writable by the web server. Please choose a different directory, use chown/chmod to change permissions, or contact your web hosting company for assistance.';
     }
     //	Create the form for display
     qa_set_display_rules($qa_content, array('event_logger_directory_display' => 'event_logger_to_files_field', 'event_logger_hide_header_display' => 'event_logger_to_files_field'));
     return array('ok' => $saved && !isset($error) ? 'Event log settings saved' : null, 'fields' => array(array('label' => 'Log events to <code>' . QA_MYSQL_TABLE_PREFIX . 'eventlog</code> database table', 'tags' => 'name="event_logger_to_database_field"', 'value' => qa_opt('event_logger_to_database'), 'type' => 'checkbox'), array('label' => 'Log events to daily log files', 'tags' => 'name="event_logger_to_files_field" id="event_logger_to_files_field"', 'value' => qa_opt('event_logger_to_files'), 'type' => 'checkbox'), array('id' => 'event_logger_directory_display', 'label' => 'Directory for log files - enter full path:', 'value' => qa_html($directory), 'tags' => 'name="event_logger_directory_field"', 'note' => $note, 'error' => qa_html($error)), array('id' => 'event_logger_hide_header_display', 'label' => 'Include header lines at top of each log file', 'type' => 'checkbox', 'tags' => 'name="event_logger_hide_header_field"', 'value' => !qa_opt('event_logger_hide_header'))), 'buttons' => array(array('label' => 'Save Changes', 'tags' => 'name="event_logger_save_button"')));
 }
开发者ID:swuit,项目名称:swuit-q2a,代码行数:28,代码来源:qa-event-logger.php

示例14: admin_form

 function admin_form(&$qa_content)
 {
     // Process form input
     $ok = null;
     if (qa_clicked('ajax_comment_save')) {
         qa_opt('ajax_comment_enable', (bool) qa_post_text('ajax_comment_enable'));
         qa_opt('ajax_comment_format', (int) qa_post_text('ajax_comment_format'));
         qa_opt('ajax_comment_username', (bool) qa_post_text('ajax_comment_username'));
         qa_opt('ajax_comment_flash_star', (bool) qa_post_text('ajax_comment_flash_star'));
         qa_opt('ajax_comment_answer_reminder', (bool) qa_post_text('ajax_comment_answer_reminder'));
         qa_opt('ajax_comment_answer_reminder_text', qa_post_text('ajax_comment_answer_reminder_text'));
         qa_opt('ajax_comment_popup_notice', (bool) qa_post_text('ajax_comment_popup_notice'));
         qa_opt('ajax_comment_popup_notice_text', qa_post_text('ajax_comment_popup_notice_text'));
         $ok = 'Settings Saved.';
     }
     $formats = array();
     $formats[] = 'plain text';
     $editors = qa_list_modules('viewer');
     if (in_array('Markdown Viewer', $editors)) {
         $formats[] = 'markdown';
     }
     $formats[] = 'html';
     // Create the form for display
     $fields = array();
     $fields[] = array('label' => 'Enable ajax comment form', 'tags' => 'NAME="ajax_comment_enable"', 'value' => qa_opt('ajax_comment_enable'), 'type' => 'checkbox');
     $fields[] = array('label' => 'Comment format', 'tags' => 'NAME="ajax_comment_format"', 'type' => 'select', 'options' => $formats, 'value' => @$formats[qa_opt('ajax_comment_format')]);
     $fields[] = array('label' => 'Add @username to comment box', 'tags' => 'NAME="ajax_comment_username"', 'value' => (int) qa_opt('ajax_comment_username'), 'type' => 'checkbox');
     $fields[] = array('label' => 'Show reminder text if commenting on answer to own question', 'tags' => 'NAME="ajax_comment_answer_reminder" onclick="if(this.checked) jQuery(\'#ajax_comment_answer_reminder_text\').fadeIn(); else jQuery(\'#ajax_comment_answer_reminder_text\').fadeOut();"', 'value' => (int) qa_opt('ajax_comment_answer_reminder'), 'type' => 'checkbox');
     $fields[] = array('tags' => 'id="ajax_comment_answer_reminder_text" name="ajax_comment_answer_reminder_text" style="display:' . (qa_opt('ajax_comment_answer_reminder') ? 'block' : 'none') . '"', 'value' => qa_html(qa_opt('ajax_comment_answer_reminder_text')), 'type' => 'text');
     $fields[] = array('label' => 'Flash select star if commenting on answer to own question', 'tags' => 'NAME="ajax_comment_flash_star"', 'value' => (int) qa_opt('ajax_comment_flash_star'), 'type' => 'checkbox');
     $fields[] = array('label' => 'Show reminder pop-up if if voting up answer to own question', 'tags' => 'NAME="ajax_comment_popup_notice" onclick="if(this.checked) jQuery(\'#ajax_comment_popup_notice_text\').fadeIn(); else jQuery(\'#ajax_comment_popup_notice_text\').fadeOut();"', 'value' => (int) qa_opt('ajax_comment_popup_notice'), 'type' => 'checkbox');
     $fields[] = array('tags' => 'id="ajax_comment_popup_notice_text" name="ajax_comment_popup_notice_text" style="display:' . (qa_opt('ajax_comment_popup_notice') ? 'block' : 'none') . '"', 'value' => qa_html(qa_opt('ajax_comment_popup_notice_text')), 'type' => 'text');
     return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => 'Save', 'tags' => 'NAME="ajax_comment_save"')));
 }
开发者ID:microbye,项目名称:q2a-comment-ajax,代码行数:34,代码来源:qa-comment-admin.php

示例15: admin_form

 function admin_form(&$qa_content)
 {
     $ok = null;
     if (qa_clicked('obvious_save_button')) {
         qa_opt('obvious_content_on', (bool) qa_post_text('obvious_content_on'));
         qa_opt('obvious_content_color', (string) qa_post_text('obvious_content_color'));
         qa_opt('obvious_max_tags', (int) qa_post_text('obvious_max_tags'));
         qa_opt('obvious_content_category_on', (bool) qa_post_text('obvious_content_category_on'));
         qa_opt('obvious_content_category_color', (string) qa_post_text('obvious_content_category_color'));
         $ok = qa_lang('admin/options_saved');
     } else {
         if (qa_clicked('obvious_reset_button')) {
             foreach ($_POST as $i => $v) {
                 $def = $this->option_default($i);
                 if ($def !== null) {
                     qa_opt($i, $def);
                 }
             }
             $ok = qa_lang('admin/options_reset');
         }
     }
     $fields = array();
     $fields[] = array('label' => 'Enable Obvious Favorite Tags', 'tags' => 'NAME="obvious_content_on"', 'value' => qa_opt('obvious_content_on'), 'type' => 'checkbox');
     $fields[] = array('label' => 'Your color in Hex', 'tags' => 'NAME="obvious_content_color"', 'value' => qa_opt('obvious_content_color'), 'type' => 'string');
     $fields[] = array('label' => 'Enable Obvious Favorite Category', 'tags' => 'NAME="obvious_content_category_on"', 'value' => qa_opt('obvious_content_category_on'), 'type' => 'checkbox');
     $fields[] = array('label' => 'Your color in Hex', 'tags' => 'NAME="obvious_content_category_color"', 'value' => qa_opt('obvious_content_category_color'), 'type' => 'string');
     $fields[] = array('type' => 'blank');
     $fields[] = array('label' => 'Maximum tags for the Widget', 'tags' => 'NAME="obvious_max_tags"', 'value' => qa_opt('obvious_max_tags'), 'type' => 'int');
     return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="obvious_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="obvious_reset_button"')));
 }
开发者ID:roine,项目名称:roine-q2a-obvious-favorite,代码行数:30,代码来源:qa-obvious-admin-form.php


注:本文中的qa_clicked函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。