/** * Create the configuration FromUI */ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { switch ($action) { case _t('Configure'): $ui = new FormUI(strtolower(get_class($this))); // add language selector $ui->append('select', 'lang', 'option:autokeyword__lang', _t('Language'), array('en' => 'English')); // add single word entries $ui->append('text', 'min_1word_length', 'option:autokeyword__min_1word_length', _t('Minimum length for one word keywords')); $ui->append('text', 'min_1word_occur', 'option:autokeyword__min_1word_occur', _t('Minimum occurance for one word keywords')); // add two word phrase entries $ui->append('text', 'min_2word_length', 'option:autokeyword__min_2word_length', _t('Minimum length for single words in two word phrases')); $ui->append('text', 'min_2phrase_length', 'option:autokeyword__min_2phrase_length', _t('Minimum length for entire two word phrase')); $ui->append('text', 'min_2phrase_occur', 'option:autokeyword__min_2phrase_occur', _t('Minimum occurance for entire two word phrase')); // add three word phrase entries $ui->append('text', 'min_3word_length', 'option:autokeyword__min_3word_length', _t('Minimum length for single words in three word phrases')); $ui->append('text', 'min_3phrase_length', 'option:autokeyword__min_3phrase_length', _t('Minimum length for entire three word phrase')); $ui->append('text', 'min_3phrase_occur', 'option:autokeyword__min_3phrase_occur', _t('Minimum occurance for entire three word phrase')); // misc $ui->append('submit', 'save', 'Save'); $ui->on_success(array($this, 'updated_config')); $ui->out(); break; } } }
/** * Respond to the user selecting an action on the plugin page * * @param string $plugin_id The string id of the acted-upon plugin * @param string $action The action string supplied via the filter_plugin_config hook */ public function configure() { $ui = new FormUI(strtolower(get_class($this))); $ping_services = $ui->append('textmulti', 'ping_services', 'option:autopinger__pingservices', _t('Ping Service URLs:')); $ui->append('submit', 'save', 'Save'); $ui->out(); }
public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { switch ($action) { case _('Configure'): $ui = new FormUI(strtolower(get_class($this))); // present the user with a list of // URL shortening services $service = $ui->append('select', 'service', 'lilliputian__service', _t('The URL shortening service to use: ')); $services = array(); $services['internal'] = 'internal'; $list = Utils::glob(dirname(__FILE__) . '/*.helper.php'); if (count($list) > 0) { foreach ($list as $item) { $item = basename($item, '.helper.php'); $services[$item] = $item; } } $service->options = $services; if (Options::get('lilliputian__service') == 'internal') { $secret = $ui->append('text', 'secret', 'lilliputian__secret', _t('The secret word that must be passed when generating short URLs. May be blank to disable this security feature.')); } $ui->append('submit', 'save', _t('Save')); $ui->out(); break; } } }
/** * Respond to the user selecting an action on the plugin page * @param string $plugin_id The string id of the acted-upon plugin * @param string $action The action string supplied via the filter_plugin_config hook **/ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id === $this->plugin_id()) { switch ($action) { case _t('Configure', $this->class_name): $ui = new FormUI($this->class_name); $type = $ui->append('select', 'type', 'option:' . $this->class_name . '__type', _t('Photostream Type', $this->class_name)); $type->options = array('public' => _t('Public photos & video', $this->class_name), 'user' => _t('Public photos & video from you', $this->class_name), 'friends' => _t('Your friends’ photostream', $this->class_name), 'faves' => _t('Public favorites from you', $this->class_name), 'group' => _t('Group pool', $this->class_name)); $type->add_validator('validate_required'); $user_id = $ui->append('text', 'user_id', 'option:' . $this->class_name . '__user_id', _t('Flickr ID (You can get it from <a href="http://idgettr.com">idGettr</a>)', $this->class_name)); $user_id->add_validator('validate_flickr_id'); $num_item = $ui->append('text', 'num_item', 'option:' . $this->class_name . '__num_item', _t('№ of Photos', $this->class_name)); $num_item->add_validator('validate_uint'); $num_item->add_validator('validate_required'); $size = $ui->append('select', 'size', 'option:' . $this->class_name . '__size', _t('Photo Size', $this->class_name)); $size->options = array('square' => _t('Square', $this->class_name), 'thumbnail' => _t('Thumbnail', $this->class_name), 'small' => _t('Small', $this->class_name), 'medium' => _t('Medium', $this->class_name), 'large' => _t('Large', $this->class_name), 'original' => _t('Original', $this->class_name)); $size->add_validator('validate_required'); $tags = $ui->append('text', 'tags', 'option:' . $this->class_name . '__tags', _t('Tags (comma separated, no space)', $this->class_name)); $cache_expiry = $ui->append('text', 'cache_expiry', 'option:' . $this->class_name . '__cache_expiry', _t('Cache Expiry (in seconds)', $this->class_name)); $cache_expiry->add_validator('validate_uint'); $cache_expiry->add_validator('validate_required'); // When the form is successfully completed, call $this->updated_config() $ui->append('submit', 'save', _t('Save', $this->class_name)); $ui->set_option('success_message', _t('Options saved', $this->class_name)); $ui->out(); break; } } }
/** * Create a configuration form for this plugin * **/ public function configure() { $form = new FormUI('popular_posts'); $form->append('checkbox', 'loggedintoo', 'popular_posts__loggedintoo', _t('Track views of logged-in users too', 'popular_posts')); $form->append('submit', 'save', 'Save'); $form->out(); }
public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { $frequencies = array('manually' => _t('Manually', 'exportsnapshot'), 'hourly' => _t('Hourly', 'exportsnapshot'), 'daily' => _t('Daily', 'exportsnapshot'), 'weekly' => _t('Weekly', 'exportsnapshot'), 'monthly' => _t('Monthly', 'exportsnapshot')); $types = array('blogml' => _t('BlogML', 'exportsnapshot'), 'wxr' => _t('WXR', 'exportsnapshot')); switch ($action) { case _t('Configure'): $ui = new FormUI('export'); $ui->append('text', 'exportsnapshot_max_snapshots', 'option:exportsnapshot__max_snapshots', _t('Max Snapshots to Save:', 'exportsnapshot')); $ui->append('select', 'exportsnapshot_freq', 'option:exportsnapshot__frequency', _t('Auto Snapshot frequency:', 'exportsnapshot'), $frequencies); $ui->append('select', 'exportsnapshot_type', 'option:exportsnapshot__type', _t('Type of export:', 'exportsnapshot'), $types); $ui->append('submit', 'save', _t('Save')); $ui->on_success(array($this, 'updated_config')); $ui->out(); break; case _t('Take Snapshot'): self::run('manual'); Session::notice(_t('Snapshot saved!', 'exportsnapshot')); //CronTab::add_single_cron('snapshot_single', array( 'ExportSnapshot', 'run' ), HabariDateTime::date_create(), 'Run a single snapshot.' ); //Session::notice( _t( 'Snapshot scheduled for next cron run.' ) ); // don't display the configuration page, just redirect back to the plugin page Utils::redirect(URL::get('admin', 'page=plugins')); break; } } }
/** * Configuration form for the Charcoal theme **/ public function action_theme_ui($theme) { $ui = new FormUI(__CLASS__); // This is a fudge as I only need to add a little bit of styling to make things look nice. $ui->append('static', 'style', '<style type="text/css">#charcoal .formcontrol { line-height: 2.2em; }</style>'); $ui->append('checkbox', 'show_title_image', __CLASS__ . '__show_title_image', _t('Show Title Image:'), 'optionscontrol_checkbox'); $ui->show_title_image->helptext = _t('Check to show the title image, uncheck to display the title text.'); $ui->append('text', 'home_label', __CLASS__ . '__home_label', _t('Home label:'), 'optionscontrol_text'); $ui->home_label->helptext = _t('Set to whatever you want your first tab text to be.'); $ui->append('checkbox', 'show_entry_paperclip', __CLASS__ . '__show_entry_paperclip', _t('Show Entry Paperclip:'), 'optionscontrol_checkbox'); $ui->show_entry_paperclip->helptext = _t('Check to show the paperclip graphic in posts, uncheck to hide it.'); $ui->append('checkbox', 'show_page_paperclip', __CLASS__ . '__show_page_paperclip', _t('Show Page Paperclip:'), 'optionscontrol_checkbox'); $ui->show_page_paperclip->helptext = _t('Check to show the paperclip graphic in pages, uncheck to hide it.'); $ui->append('checkbox', 'show_powered', __CLASS__ . '__show_powered', _t('Show Powered By:'), 'optionscontrol_checkbox'); $ui->show_powered->helptext = _t('Check to show the "powered by Habari" graphic in the sidebar, uncheck to hide it.'); $ui->append('checkbox', 'display_login', __CLASS__ . '__display_login', _t('Display Login:'******'optionscontrol_checkbox'); $ui->display_login->helptext = _t('Check to show the Login/Logout link in the navigation bar, uncheck to hide it.'); $ui->append('checkbox', 'tags_in_multiple', __CLASS__ . '__tags_in_multiple', _t('Tags in Multiple Posts Page:'), 'optionscontrol_checkbox'); $ui->tags_in_multiple->helptext = _t('Check to show the post tags in the multiple posts pages (search, tags, archives), uncheck to hide them.'); $ui->append('checkbox', 'show_post_nav', __CLASS__ . '__show_post_nav', _t('Show Post Navigation:'), 'optionscontrol_checkbox'); $ui->show_post_nav->helptext = _t('Set to true to show single post navigation links, false to hide them.'); $ui->append('text', 'tags_count', __CLASS__ . '__tags_count', _t('Tag Cloud Count:'), 'optionscontrol_text'); $ui->tags_count->helptext = _t('Set to the number of tags to display on the default "cloud".'); // Save $ui->append('submit', 'save', _t('Save')); $ui->set_option('success_message', _t('Options saved')); $ui->out(); }
public function configure() { $ui = new FormUI('acronyms'); $iam_key = $ui->append('textarea', 'acronyms', 'acronyms__acronyms', _t('Acronyms')); $ui->append('submit', 'save', _t('Save')); $ui->out(); }
/** * Create a configuration form for this plugin * **/ public function configure() { $form = new FormUI('relativelypopular'); $form->append('checkbox', 'loggedintoo', 'relativelypopular__loggedintoo', _t('Track visits of logged-in users too', 'relativelypopular')); $form->append('text', 'number_of_periods', 'relativelypopular__number_of_periods', _t('Number of periods to track [default=30]', 'relativelypopular')); $form->append('text', 'period_length_days', 'relativelypopular__period_length_days', _t('Tracking period length (days) [default=1]', 'relativelypopular')); $form->append('submit', 'save', 'Save'); $form->out(); }
public function configure() { $class_name = strtolower(get_class($this)); $form = new FormUI($class_name); $form->append('select', 'frequency', 'database_optimizer__frequency', _t('Optimization Frequency'), array('hourly' => 'hourly', 'daily' => 'daily', 'weekly' => 'weekly', 'monthly' => 'monthly')); $form->append('submit', 'save', _t('Save')); $form->on_success(array($this, 'updated_config')); $form->out(); }
/** * Creates a UI form to handle the plugin configuration * * @param string $plugin_id The id of a plugin * @param array $actions An array of actions that apply to this plugin */ public function action_plugin_ui($plugin_id, $action) { if ($this->plugin_id() == $plugin_id && $action == 'Configure') { $form = new FormUI(strtolower(get_class($this))); $form->append('checkbox', 'enable SmartyPants', 'option:habarimarkdown__smarty', _t('Enable SmartyPants')); $form->append('submit', 'save', _t('Save')); $form->out(); } }
public function configure() { $form = new FormUI('preapproved'); $form->append('text', 'approved_count', 'option:preapproved__approved_count', _t('Required number of approved comments: ')); $form->approved_count->add_validator(array($this, 'validate_integer')); $form->append('submit', 'save', _t('Save')); $form->set_option('success_message', _t('Configuration saved')); $form->out(); }
public function action_plugin_ui_configure() { $ui = new FormUI('autoclose'); $age_in_days = $ui->append('text', 'age_in_days', 'autoclose__age_in_days', _t('Post age (days) for autoclose', 'autoclose')); $age_in_days->add_validator('validate_required'); $ui->append('submit', 'save', _t('Save', 'autoclose')); $ui->set_option('success_message', _t('Configuration saved', 'autoclose')); $ui->on_success(array($this, 'updated_config')); $ui->out(); }
public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { $ui = new FormUI('urlapprove'); $ui->append('checkbox', 'redirect_default', 'urlapprove__redirect_default', _t('Redirect all comment author links by default', 'urlapprove')); $ui->append('textarea', 'whitelist', 'urlapprove__whitelist', _t('Whitelist of domains that will not be redirected, one per line (does not auto-approve)')); $ui->append('submit', 'submit', 'Submit'); $ui->out(); } }
public function configure() { $ui = new FormUI(strtolower(get_class($this))); $clientcode = $ui->append('text', 'clientcode', 'googleads__clientcode', _t('Ad Client Code')); $adslot = $ui->append('text', 'adslot', 'googleads__adslot', _t('Ad Slot ID')); $adwidth = $ui->append('text', 'adwidth', 'googleads__adwidth', _t('Ad Width')); $adheight = $ui->append('text', 'adheight', 'googleads__adheight', _t('Ad Height')); $ui->append('submit', 'save', _t('Save')); $ui->out(); }
/** * Respond to the user selecting an action on the theme page */ public function action_theme_ui($theme) { $ui = new FormUI(strtolower(get_class($this))); $ui->append('text', 'home_tab', 'option:' . $this->class_name . '__home_tab', _t('Link Text to Home')); $ui->home_tab->add_validator('validate_required'); $ui->append('checkbox', 'show_author', 'option:' . $this->class_name . '__show_author', _t('Display author in posts')); // Save $ui->append('submit', 'save', _t('Save')); $ui->set_option('success_message', _t('Options saved')); $ui->out(); }
/** * Handle calls from FormUI actions. * Show the form to manage the plugin's options. * */ public function configure() { $ui = new FormUI('gravatar'); $g_s_d = $ui->append('text', 'default', 'gravatar__default', '<dl><dt>' . _t('Default Gravatar', __CLASS__) . '</dt><dd>' . _t('An optional "default" parameter may follow that specifies the full, URL encoded URl, protocol included of a GIF, JPEG or PNG image that should be returned if either the request email address has no associated gravatar, or that gravatar has a rating higher than is allowed by the "rating" parameter.', __CLASS__) . '</dd></dl>'); $g_s_s = $ui->append('text', 'size', 'gravatar__size', '<dl><dt>' . _t('Size', __CLASS__) . '</dt><dd>' . _t('An optional "size" parameter may follow that specifies the desired width and height of the gravatar. Valid vaues are from 1 to 80 inclusive. Any size other than 80 will cause the original gravatar image to be downsampled using bicubic resampling before output.', __CLASS__) . '</dd></dl>'); //mark size as required $g_s_s->add_validator('validate_required'); $g_s_r = $ui->append('select', 'rating', 'gravatar__rating', '<dl><dt>' . _t('Rating', __CLASS__) . '</dt><dd>' . _t('An optional "rating" parameter may follow with a value of [ G | PG | R | X ] that determines the highest rating (inclusive) that will be returned.', __CLASS__) . '</dd></dl>', array('G' => 'G', 'PG' => 'PG', 'R' => 'R', 'X' => 'X')); $ui->append('submit', 'save', _t('Save')); $ui->out(); }
/** * Respond to the user selecting an action on the plugin page * * @param string $plugin_id The string id of the acted-upon plugin * @param string $action The action string supplied via the filter_plugin_config hook */ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { if ($action == 'Configure') { $ui = new FormUI('userfields'); $ui->append('textmulti', 'fields', 'userfields__fields', _t('Additional User Fields:')); $ui->append('submit', 'submit', 'Submit'); $ui->out(); } } }
/** * action: plugin_ui * * @access public * @param string $plugin_id * @param string $action * @return void */ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id != $this->plugin_id()) { return; } if ($action == _t('Configure')) { $form = new FormUI(strtolower(get_class($this))); $form->append('select', 'week_start', 'calendar__week_start', _t('Week starts on: ', 'calendar'), $this->week_starts); $form->append('submit', 'save', _t('Save')); $form->out(); } }
/** * action: plugin_ui * * @access public * @param string $plugin_id * @param string $action * @return void */ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id != $this->plugin_id()) { return; } if ($action == _t('Configure')) { $form = new FormUI(strtolower(get_class($this))); $form->append('textarea', 'ipbl', 'dnsbl__ipbl', _t('IP Blacklists: ', 'dnsbl')); $form->append('submit', 'save', _t('Save')); $form->out(); } }
/** * Respond to the user selecting 'configure' on the themes page * */ public function action_theme_ui() { $form = new FormUI('simplerer_theme'); $copyright_notice = $form->append('text', 'copyright_notice', 'simplerer__copyright_notice', _t('Copyright Notice')); $copyright_notice->template = 'optionscontrol_text'; $copyright_notice->class = 'clear'; $copyright_notice->raw = true; $copyright_notice->helptext = _t('Use %year to substitute in the current year.'); $form->append('submit', 'save', 'Save'); $form->set_option('success_message', _t('Theme Settings Updated')); $form->out(); }
public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { switch ($action) { case _t('Configure'): $ui = new FormUI(strtolower(get_class($this))); $customvalue = $ui->append('text', 'customvalue', 'cpg__customvalue', _t('Your custom value:')); $ui->out(); break; } } }
/** * Implement the simple plugin configuration. * @return FormUI The configuration form */ public function configure() { $ui = new FormUI('maintenance_mode'); // Add a text control for the maintenance mode text $ui->append('textarea', 'mm_text', self::OPTION_NAME . '__text', _t('Display Text: ')); // Add checkbox to put in/out of maintenance mode $ui->append('checkbox', 'in_maintenance', self::OPTION_NAME . '__in_maintenance', _t('In Maintenance Mode')); $ui->append('checkbox', 'display_feeds', self::OPTION_NAME . '__display_feeds', _t('Display Feeds When In Maintenance Mode')); $ui->append('submit', 'save', _t('Save')); $ui->on_success(array($this, 'updated_config')); $ui->out(); }
public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { switch ($action) { case _t('Configure'): $form = new FormUI(strtolower(get_class($this))); $form->append('textmulti', 'endpoints', 'pubsubhubbub__endpoints', _t('Custom hubs')); $form->append('submit', 'save', 'Save'); $form->out(); break; } } }
public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { switch ($action) { case _t('Configure'): $form = new FormUI(strtolower(get_class($this))); $form->append('text', 'username', 'disqus__username', _t('Disqus Username:'******'submit', 'save', 'Save'); $form->out(); break; } } }
public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { switch ($action) { case _t('Configure'): $ui = new FormUI(strtolower(get_class($this))); $customvalue = $ui->append('textmulti', 'feedname', 'chicklet__feedname', _t('Feed Addresses:')); $customvalue = $ui->append('submit', 'submit', _t('Save')); $ui->out(); break; } } }
/** * action: plugin_ui * * @access public * @param string $plugin_id * @param string $action * @return void */ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id != $this->plugin_id()) { return; } if ($action == _t('Configure')) { $form = new FormUI(strtolower(get_class($this))); $form->append('text', 'username', 'photozousilo__username', _t('Photozou Username: '******'text', 'password', 'photozousilo__password', _t('Photozou Password: '******'submit', 'save', _t('Save')); $form->out(); } }
/** * Respond to the user selecting an action on the plugin page * @param string $plugin_id The string id of the acted-upon plugin * @param string $action The action string supplied via the filter_plugin_config hook **/ public function action_plugin_ui_configure() { $ui = new FormUI(strtolower(get_class($this))); $reload_fieldset = $ui->append('fieldset', 'reload', _t('No Message')); $reload_page = $reload_fieldset->append('checkbox', 'reload', 'option:diggbarblocker__reload', _t('Instead of displaying a message, reload the page without the bar')); $message_fieldset = $ui->append('fieldset', 'message_settings', _t('Message Settings')); $message = $message_fieldset->append('textarea', 'message', 'option:diggbarblocker__message', _t('If the box above is not checked, display this to Diggbar-using visitors:')); $message->rows = 2; $message->class[] = 'resizable'; $link = $message_fieldset->append('checkbox', 'addlink', 'option:diggbarblocker__addlink', _t('Add a link to the target page.')); $ui->append('submit', 'save', _t('Save')); $ui->out(); }
/** * Populate the plugin config form */ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { if ($action == _t('Configure')) { $ui = new FormUI(strtolower(get_class($this))); $notify_posts = $ui->append('checkbox', 'notify_posts', 'notify_all__notify_posts', _t('Send email notifications for posts', 'notify_all')); $notify_comments = $ui->append('checkbox', 'notify_comments', 'notify_all__notify_comments', _t('Send email notifications for comments', 'notify_all')); $notify_user_can_override = $ui->append('checkbox', 'user_can_override', 'notify_all__user_can_override', _t('User can set whether notifications are sent', 'notify_all')); $ui->append('submit', 'save', 'Save'); $ui->out(); } } }
/** * Create configuration panel */ public function action_plugin_ui($plugin_id, $action) { if ($plugin_id == $this->plugin_id()) { switch ($action) { case _t('Configure'): $form = new FormUI(strtolower(get_class($this))); $form->append('text', 'search', 'simplenote__search', _t('Search query:')); $form->append('submit', 'save', _t('Save')); $form->out(); break; } } }