예제 #1
0
 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();
 }
 /**
  * Executes when the admin plugins page wants to display the UI for a particular plugin action.
  * Displays the plugin's UI.
  * 
  * @param string $plugin_id The unique id of a plugin
  * @param string $action The action to display
  */
 public function action_plugin_ui($plugin_id, $action)
 {
     // Display the UI for this plugin?
     if ($plugin_id == $this->plugin_id) {
         // Depending on the action specified, do different things
         switch ($action) {
             // For the action 'configure':
             case 'Configure':
                 // Create a new Form called 'lifestream'
                 $ui = new FormUI('lifestream');
                 // Add a text control for the feed URL
                 $feedurl = $ui->append('text', 'feedurl', 'lifestream__feedurl', _t('Feed URL'));
                 // Mark the field as required
                 $feedurl->add_validator('validate_required');
                 // Mark the field as requiring a valid URL
                 $feedurl->add_validator('validate_url');
                 // Add a text control for the rewrite base
                 $rewritebase = $ui->append('text', 'lifeurl', 'lifestream__lifeurl', _t('Lifestream URL'));
                 // Mark the field as required
                 $rewritebase->add_validator('validate_required');
                 // Add a text control for the entries per page
                 $perpage = $ui->append('text', 'perpage', 'lifestream__perpage', _t('Items Per Page'));
                 // Mark the field as required
                 $perpage->add_validator('validate_required');
                 $submit = $ui->append('submit', 'submit', _t('Save'));
                 // Display the form
                 $ui->out();
                 break;
         }
     }
 }
 /**
  * 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;
         }
     }
 }
예제 #4
0
 public function get_form($group = null)
 {
     if ($group == null) {
         $group = Options::get('register__group');
         if ($group == null) {
             $group = 'anonymous';
         }
     }
     $form = new FormUI('registration');
     $form->class[] = 'registration';
     $form->append('text', 'email', 'null:null', _t('Email', __CLASS__), 'formcontrol_text');
     $form->email->add_validator('validate_email');
     $form->append('text', 'username', 'null:null', _t('Username', __CLASS__), 'formcontrol_text');
     $form->username->add_validator('validate_required');
     $form->username->add_validator('validate_username');
     $form->append('password', 'password', 'null:null', _t('Password', __CLASS__), 'formcontrol_password');
     $form->password->add_validator('validate_required');
     $form->append('password', 'password_confirmation', 'null:null', _t('Confirm Password', __CLASS__), 'formcontrol_password');
     $form->password_confirmation->add_validator('validate_required');
     $form->password_confirmation->add_validator('validate_same', $form->password);
     // Store the group to be added. This is stored locally, not retrieved from unsafe data.
     $form->set_option('group_name', $group);
     // Create the Register button
     $form->append('submit', 'register', _t('Register', __CLASS__), 'formcontrol_submit');
     $form->on_success(array($this, 'register_user'));
     // Return the form object
     return $form;
 }
 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;
         }
     }
 }
예제 #6
0
 /**
  * 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 == _t('Configure')) {
             $ui = new FormUI(strtolower(get_class($this)));
             $twitter_username = $ui->append('text', 'username', 'twitter__username', _t('Twitter Username:'******'password', 'password', 'twitter__password', _t('Twitter Password:'******'fieldset', 'post_settings', _t('Autopost Updates from Habari'));
             $twitter_post = $post_fieldset->append('checkbox', 'post_status', 'twitter__post_status', _t('Autopost to Twitter:'));
             $twitter_post = $post_fieldset->append('text', 'prepend', 'twitter__prepend', _t('Prepend to Autopost:'));
             $twitter_post->value = "New Blog Post:";
             $tweet_fieldset = $ui->append('fieldset', 'tweet_settings', _t('Displaying Status Updates'));
             $twitter_show = $tweet_fieldset->append('checkbox', 'show', 'twitter__show', _t('Display twitter status updates in Habari'));
             $twitter_limit = $ui->append('select', 'limit', 'twitter__limit', _t('Number of updates to show'));
             $twitter_limit->options = array_combine(range(1, 20), range(1, 20));
             $twitter_show = $tweet_fieldset->append('checkbox', 'hide_replies', 'twitter__hide_replies', _t('Do not show @replies'));
             $twitter_show = $tweet_fieldset->append('checkbox', 'linkify_urls', 'twitter__linkify_urls', _t('Linkify URLs'));
             $twitter_hashtags = $tweet_fieldset->append('text', 'hashtags_query', 'twitter__hashtags_query', _t('#hashtags query link:'));
             $twitter_cache_time = $ui->append('text', 'cache', 'twitter__cache', _t('Cache expiry in seconds:'));
             $ui->on_success(array($this, 'updated_config'));
             $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 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();
 }
 /**
  * Simple plugin configuration
  * @return FormUI The configuration form
  **/
 public function configure()
 {
     $form = new FormUI('postmark');
     $form->append(new FormControlText('apikey', 'postmark__apikey', 'API Key'));
     $form->append(new FormControlSubmit('save', _t('Save')));
     return $form;
 }
예제 #9
0
 public function configure()
 {
     $ui = new FormUI(strtolower(get_class($this)));
     $clientcode = $ui->append('textarea', 'clientcode', 'freestyle__css', _t('FreeStyle CSS'));
     $ui->append('submit', 'save', _t('Save'));
     return $ui;
 }
 /**
  * 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()) {
         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;
         }
     }
 }
 public function configure()
 {
     $form = new FormUI(__CLASS__);
     $form->append('checkbox', 'hide_social', __CLASS__ . 'hide_social', _t('Hide social area in fullsize image view', __CLASS__));
     $form->append('submit', 'submit', _t('Save'));
     return $form;
 }
예제 #13
0
 public function configure()
 {
     $ui = new FormUI('mpango_config');
     $ui->append('text', 'github_id', 'mpango__github_id', _t('GitHub ID (optional)'));
     $ui->append('text', 'github_secret', 'mpango__github_secret', _t('GitHub Secret (optional)'));
     $ui->append('submit', 'save', _t('Save'));
     return $ui;
 }
예제 #14
0
 public function configure()
 {
     $form = new FormUI('slugsync');
     $form->append('checkbox', 'draft_updates', 'slugsync__draftupdates', _t('Only update when post status is draft: ', 'slugsync'));
     $form->append('submit', 'save', 'Save');
     $form->set_option('success_message', _t('Slugsync options saved.', 'slugsync'));
     return $form;
 }
 /**
  * Respond to the user selecting Configure on the plugin page
  **/
 public function configure()
 {
     $ui = new FormUI(strtolower(get_class($this)));
     $ui->append('text', 'count', 'related_posts__count', _t('No. of posts to be shown'));
     $ui->append('text', 'header', 'related_posts__header', _t('Header for Related Posts list'));
     $ui->append('submit', 'save', _t('Save'));
     return $ui;
 }
 public function configure()
 {
     $class_name = strtolower(get_class($this));
     $ui = new FormUI($class_name);
     $add_title = $ui->append('checkbox', 'add_title', $class_name . '__add_title', _t('Include title words in count?'));
     $ui->append('submit', 'save', 'save');
     return $ui;
 }
예제 #17
0
 public function configure()
 {
     $form = new FormUI(strtolower(get_class($this)));
     $form->append('static', 'why_suppress', _t('<small>If you suppress the list, you can add them manually using the $post->footnotes array.</small>'));
     $form->append('checkbox', 'suppress_list', 'footnotes__suppress_list', _t('Don\'t append the footnote list to posts'));
     $form->append('submit', 'save', _t('Save'));
     return $form;
 }
 /**
  * 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();
     }
 }
예제 #19
0
 public function configure()
 {
     $ui = new FormUI('ieadmin');
     $ver = $ui->append('text', 'ieversion', 'ieadmin__ieversion', _t('IE version to be compatible with (e.g. 8)', 'ieadmin'));
     $ver->add_validator('validate_regex', '/^[7-9]*$/', _t('Please enter a valid version number between 7-9.', 'ieadmin'));
     $ui->append('text', 'jsversion', 'ieadmin__jsversion', _t('Script version, if not using "' . self::JS_VERSION . '"', 'isadmin'));
     $ui->append('submit', 'save', 'save');
     return $ui;
 }
 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();
 }
 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();
 }
 /**
  * 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()
 {
     $ui = new FormUI(strtolower(get_class($this)));
     $css_location = $ui->append('text', 'css_location', 'option:freestyleadmin__css_location', _t('FreeStyle CSS Location', 'FreeStyleAdmin'));
     $css_location->add_validator('validate_required');
     $ui->append('submit', 'save', _t('Save', 'FreeStyleAdmin'));
     $ui->set_option('success_message', _t('Configuration saved', 'FreeStyleAdmin'));
     return $ui;
 }
 public function configure()
 {
     $form = new FormUI('threaded_comment');
     $depth = $form->append('text', 'threaded_depth', 'threaded_comment__depth', _t('Max depth of thread:'));
     $depth->add_validator('validate_regex', '/^[0-9]*$/', _t('Please enter a valid positive integer.'));
     $form->append('submit', 'save', _t('Save'));
     $form->set_option('success_message', _t('Configuration saved'));
     return $form;
 }
예제 #25
0
 /**
  * Show options on plugins admin page
  */
 public function configure()
 {
     $ui = new FormUI(strtolower(get_class($this)));
     $ui->append('textarea', 'original_text', 'linkblog__original', _t('Text to use for describing original in feeds:'));
     $ui->original_text->rows = 2;
     $ui->append('checkbox', 'atom_permalink', 'linkblog__atom_permalink', _t('Override atom permalink with link URL'));
     $ui->append('submit', 'save', _t('Save'));
     return $ui;
 }
예제 #26
0
 public function configure()
 {
     $ui = new FormUI('tracfeed');
     $connection_string = $ui->append('text', 'connection_string', 'tracfeed__connection_string', _t('Connection String:', 'tracfeed'));
     $username = $ui->append('text', 'username', 'tracfeed__username', _t('Username (or blank for sqlite):', 'tracfeed'));
     $password = $ui->append('password', 'password', 'tracfeed__password', _t('Password (or blank for sqlite):', 'tracfeed'));
     $ui->on_success(array($this, 'updated_config'));
     $ui->append('submit', 'save', _t('Save', 'tracfeed'));
     return $ui;
 }
예제 #27
0
 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();
 }
예제 #28
0
 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();
     }
 }
예제 #29
0
 /**
  * Add the Add Item form to the theme for display
  */
 public function get_additem_form()
 {
     $additem_form = new FormUI('dash_additem');
     $additem_form->append('select', 'module', 'null:unused');
     $additem_form->module->options = Plugins::filter('dashboard_block_list', array());
     $additem_form->append('submit', 'submit', _t('+'));
     //$form->on_success( array( $this, 'dash_additem' ) );
     $additem_form->properties['onsubmit'] = "dashboard.add(); return false;";
     $this->theme->additem_form = $additem_form->get();
 }
예제 #30
0
 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();
 }