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


PHP General::Sanitize方法代码示例

本文整理汇总了PHP中General::Sanitize方法的典型用法代码示例。如果您正苦于以下问题:PHP General::Sanitize方法的具体用法?PHP General::Sanitize怎么用?PHP General::Sanitize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在General的用法示例。


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

示例1: append_preferences

 public function append_preferences($context)
 {
     # Add new fieldset
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'CacheLite'));
     # Add Site Reference field
     $label = Widget::Label('Cache Period');
     $label->appendChild(Widget::Input('settings[cachelite][lifetime]', General::Sanitize($this->_get_lifetime())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Length of cache period in seconds.', array('class' => 'help')));
     $label = Widget::Label('Excluded URLs');
     $label->appendChild(Widget::Textarea('cachelite[excluded-pages]', 10, 50, $this->_get_excluded_pages()));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Add a line for each URL you want to be excluded from the cache. Add a <code>*</code> to the end of the URL for wildcard matches.', array('class' => 'help')));
     $label = Widget::Label();
     $input = Widget::Input('settings[cachelite][show-comments]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('show-comments', 'cachelite') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Show comments in page source?');
     $group->appendChild($label);
     $label = Widget::Label();
     $input = Widget::Input('settings[cachelite][backend-delegates]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('backend-delegates', 'cachelite') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Expire cache when entries are created/updated through the backend?');
     $group->appendChild($label);
     $context['wrapper']->appendChild($group);
 }
开发者ID:nickdunn,项目名称:cachelite,代码行数:31,代码来源:extension.driver.php

示例2: append_preferences

 public function append_preferences($context)
 {
     # Add new fieldset
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'PayPal Payments'));
     # Add Merchant Email field
     $label = Widget::Label('Merchant Email/Account ID');
     $label->appendChild(Widget::Input('settings[paypal-payments][business]', General::Sanitize($this->_get_paypal_business())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'The merchant email address or account ID of the payment recipient.', array('class' => 'help')));
     # Country <select>
     $countries = array('Australia', 'United Kingdom', 'United States');
     $selected_country = $this->_get_country();
     foreach ($countries as $country) {
         $selected = $country == $selected_country ? TRUE : FALSE;
         $options[] = array($country, $selected);
     }
     $label = Widget::Label();
     $select = Widget::Select('settings[paypal-payments][country]', $options);
     $label->setValue('PayPal Country' . $select->generate());
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Country you want to target.', array('class' => 'help')));
     # Sandbox
     $label = Widget::Label();
     $input = Widget::Input('settings[paypal-payments][sandbox]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('sandbox', 'paypal-payments') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Enable testing mode');
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Directs payments to PayPal’s Sandbox: <code>http://www.sandbox.paypal.com/</code>', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:34,代码来源:extension.driver.php

示例3: addCustomPreferenceFieldsets

 public function addCustomPreferenceFieldsets($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Can Of Spam Filter'));
     $uniqueID = Widget::Label('Unique ID');
     $uniqueID->appendChild(Widget::Input('settings[canofspam][uniqueid]', General::Sanitize($this->getUniqueID())));
     $group->appendChild($uniqueID);
     $context['wrapper']->appendChild($group);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:10,代码来源:extension.driver.php

示例4: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Admin Rainbow Headline'));
     $label = Widget::Label('Headline Background Color');
     $label->appendChild(Widget::Input('settings[admin_rainbow_headline][headline_color]', General::Sanitize(Administration::instance()->Configuration->get('headline_color', 'admin_rainbow_headline'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'This can be any RGB-Hexvalue, for example <code>#97712B</code>', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:11,代码来源:extension.driver.php

示例5: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', __('Language Redirect')));
     $label = Widget::Label(__('Language codes'));
     $label->appendChild(Widget::Input('settings[language_redirect][language_codes]', General::Sanitize(Symphony::Configuration()->get('language_codes', 'language_redirect'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', __('Comma separated list of supported language codes. First language ist the default language. Leave empty to disable <code>.htaccess</code>-rules.'), array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:klaftertief,项目名称:language_redirect,代码行数:11,代码来源:extension.driver.php

示例6: __construct

 public function __construct()
 {
     $this->path = General::Sanitize(Symphony::Configuration()->get('path', 'dump_db'));
     $this->format = General::Sanitize(Symphony::Configuration()->get('format', 'dump_db'));
     if ($this->format == "") {
         $this->format = '%1$s.sql';
     }
     if ($this->path == "") {
         $this->path = "/workspace";
     }
 }
开发者ID:nils-werner,项目名称:dump_db,代码行数:11,代码来源:extension.driver.php

示例7: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Akismet Spam Filtering'));
     $label = Widget::Label('Wordpress API Key');
     $label->appendChild(Widget::Input('settings[akismet][api-key]', General::Sanitize($this->getWordpressApiKey())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Get a Wordpress API key from the <a href="http://wordpress.com/api-keys/">Wordpress site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:pointybeard,项目名称:akismet,代码行数:11,代码来源:extension.driver.php

示例8: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Map Location Field'));
     $label = Widget::Label('Google Maps API Key');
     $label->appendChild(Widget::Input('settings[map-location-field][google-api-key]', General::Sanitize($context['parent']->Configuration->get('google-api-key', 'map-location-field'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Get a Google Maps API key from the <a href="http://code.google.com/apis/maps/index.html">Google Maps site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:pointybeard,项目名称:maplocationfield,代码行数:11,代码来源:extension.driver.php

示例9: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'reCAPTCHA Verification'));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label('Public Key');
     $label->appendChild(Widget::Input('settings[recaptcha][public-key]', General::Sanitize($this->_Parent->Configuration->get('public-key', 'recaptcha'))));
     $div->appendChild($label);
     $label = Widget::Label('Private Key');
     $label->appendChild(Widget::Input('settings[recaptcha][private-key]', General::Sanitize($this->_Parent->Configuration->get('private-key', 'recaptcha'))));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Get a reCAPTCHA API public/private key pair from the <a href="http://recaptcha.net/whyrecaptcha.html">reCAPTCHA site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:pointybeard,项目名称:recaptcha,代码行数:16,代码来源:extension.driver.php

示例10: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Interspire Email Marketer Filter'));
     $path = Widget::Label('XML Path');
     $path->appendChild(Widget::Input('settings[interspire][path]', General::Sanitize($this->get('path'))));
     $group->appendChild($path);
     $username = Widget::Label('Username');
     $username->appendChild(Widget::Input('settings[interspire][username]', General::Sanitize($this->get('username'))));
     $group->appendChild($username);
     $token = Widget::Label('User Token');
     $token->appendChild(Widget::Input('settings[interspire][token]', General::Sanitize($this->get('token'))));
     $group->appendChild($token);
     $context['wrapper']->appendChild($group);
 }
开发者ID:brendo,项目名称:interspire,代码行数:16,代码来源:extension.driver.php

示例11: appendPreferences

 public function appendPreferences($context)
 {
     $fieldset = new XMLElement('fieldset');
     $fieldset->setAttribute('class', 'settings');
     $context['wrapper']->appendChild($fieldset);
     $legend = new XMLElement('legend', __('Address Field'));
     $fieldset->appendChild($legend);
     $label = Widget::Label(__('Google Maps API Key'));
     $fieldset->appendChild($label);
     $key = General::Sanitize($context['parent']->Configuration->get('google-api-key', 'address-field'));
     $input = Widget::Input('settings[address-field][google-api-key]', $key);
     $label->appendChild($input);
     $text = __("You'll need to <a href=\"http://code.google.com/apis/maps/signup.html\">grab a Google Maps API key for <em>http://{$_SERVER['HTTP_HOST']}/</em></a> before you can geocode addresses.");
     $p = new XMLElement('p', $text, array('class' => 'help'));
     $fieldset->appendChild($p);
 }
开发者ID:jeremyboles,项目名称:symphony-address_field,代码行数:16,代码来源:extension.driver.php

示例12: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'reCAPTCHA v.2.0 Verification'));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label('Public Key');
     $label->appendChild(Widget::Input('settings[recaptcha2][public-key]', General::Sanitize(Symphony::Configuration()->get('public-key', 'recaptcha2'))));
     $div->appendChild($label);
     $label = Widget::Label('Private Key');
     $label->appendChild(Widget::Input('settings[recaptcha2][private-key]', General::Sanitize(Symphony::Configuration()->get('private-key', 'recaptcha2'))));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Get a reCAPTCHA v.2.0 API public/private key pair from the <a href="https://www.google.com/recaptcha/">reCAPTCHA site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:reallyalexpro,项目名称:recaptcha2,代码行数:16,代码来源:extension.driver.php

示例13: addCustomPreferenceFieldsets

 public function addCustomPreferenceFieldsets($context)
 {
     $fieldset = new XMLElement('fieldset');
     $fieldset->setAttribute('class', 'settings');
     $fieldset->appendChild(new XMLElement('legend', 'Mailchimp'));
     $group = new XMLElement('div');
     $group->setAttribute('class', 'group');
     $api = Widget::Label('API Key');
     $api->appendChild(Widget::Input('settings[mailchimp][key]', General::Sanitize($this->getKey())));
     $api->appendChild(new XMLElement('p', Widget::Anchor(__('Generate your API Key'), 'http://kb.mailchimp.com/article/where-can-i-find-my-api-key'), array('class' => 'help')));
     $group->appendChild($api);
     $list = Widget::Label('Default List ID');
     $list->appendChild(Widget::Input('settings[mailchimp][list]', General::Sanitize($this->getList())));
     $list->appendChild(new XMLElement('p', __('Can be overidden from the frontend'), array('class' => 'help')));
     $group->appendChild($list);
     $fieldset->appendChild($group);
     $context['wrapper']->appendChild($fieldset);
 }
开发者ID:saydulk,项目名称:mailchimp,代码行数:18,代码来源:extension.driver.php

示例14: appendPreferences

 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', __('Cloudinary Credentials')));
     $div = new XMLElement('div', NULL, array('class' => 'two columns'));
     $label = Widget::Label(__('API Key ID'));
     $label->setAttribute('class', 'column');
     $label->appendChild(Widget::Input('settings[cloudinary_upload_field][api-key]', General::Sanitize($this->getCloudinaryApiKey())));
     $div->appendChild($label);
     $label = Widget::Label('Secret Access Key');
     $label->setAttribute('class', 'column');
     $label->appendChild(Widget::Input('settings[cloudinary_upload_field][api-secret]', General::Sanitize($this->getCloudinarySecretKey()), 'password'));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Get a API Key and Secret Key from the <a href="http://cloudinary.com">Cloudinary Services site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:alixon,项目名称:cloudinary_upload_field,代码行数:18,代码来源:extension.driver.php

示例15: __appendPreferences

 public function __appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Sitemap'));
     $label = Widget::Label('Home page type');
     $label->appendChild(Widget::Input('settings[sitemap][index_type]', General::Sanitize(Symphony::Configuration()->get('index_type', 'sitemap'))));
     $group->appendChild($label);
     $label = Widget::Label('Primary page types (top level)');
     $label->appendChild(Widget::Input('settings[sitemap][primary_type]', General::Sanitize(Symphony::Configuration()->get('primary_type', 'sitemap'))));
     $group->appendChild($label);
     $label = Widget::Label('Utility page types (global navigation)');
     $label->appendChild(Widget::Input('settings[sitemap][utilities_type]', General::Sanitize(Symphony::Configuration()->get('utilities_type', 'sitemap'))));
     $group->appendChild($label);
     $label = Widget::Label('Excluded page types');
     $label->appendChild(Widget::Input('settings[sitemap][exclude_type]', General::Sanitize(Symphony::Configuration()->get('exclude_type', 'sitemap'))));
     $group->appendChild($label);
     $context['wrapper']->appendChild($group);
 }
开发者ID:symphonists,项目名称:sitemap,代码行数:19,代码来源:extension.driver.php


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