本文整理汇总了PHP中Redaxscript\Db::getSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::getSetting方法的具体用法?PHP Db::getSetting怎么用?PHP Db::getSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redaxscript\Db
的用法示例。
在下文中一共展示了Db::getSetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* render the view
*
* @since 3.0.0
*
* @return string
*/
public function render()
{
$output = Hook::trigger('loginFormStart');
$outputLegend = null;
/* html elements */
$titleElement = new Html\Element();
$titleElement->init('h2', ['class' => 'rs-title-content'])->text($this->_language->get('login'));
if (Db::getSetting('recovery')) {
$linkElement = new Html\Element();
$linkElement->init('a', ['href' => $this->_registry->get('parameterRoute') . 'login/recover']);
$outputLegend = $linkElement->text($this->_language->get('recovery_question') . $this->_language->get('question_mark'));
}
$formElement = new Html\Form($this->_registry, $this->_language);
$formElement->init(['form' => ['class' => 'rs-js-validate-form rs-form-default rs-form-login'], 'button' => ['submit' => ['name' => get_class()]]], ['captcha' => Db::getSetting('captcha') > 0]);
/* create the form */
$formElement->append('<fieldset>')->legend($outputLegend)->append('<ul><li>')->label('* ' . $this->_language->get('user'), ['for' => 'user'])->text(['autofocus' => 'autofocus', 'id' => 'user', 'name' => 'user', 'pattern' => '[a-zA-Z0-9]{1,30}', 'required' => 'required'])->append('</li><li>')->label('* ' . $this->_language->get('password'), ['for' => 'password'])->password(['id' => 'password', 'name' => 'password', 'pattern' => '[a-zA-Z0-9]{1,30}', 'required' => 'required'])->append('</li>');
if (Db::getSetting('captcha') > 0) {
$formElement->append('<li>')->captcha('task')->append('</li>');
}
$formElement->append('</ul></fieldset>');
if (Db::getSetting('captcha') > 0) {
$formElement->captcha('solution');
}
$formElement->token()->submit();
/* collect output */
$output .= $titleElement . $formElement;
$output .= Hook::trigger('loginFormEnd');
return $output;
}
示例2: _writeXML
/**
* @param object $categories
* @param object $articles
*
* @return string
*/
protected static function _writeXML($categories = null, $articles = null)
{
$writer = new XMLWriter();
$writer->openMemory();
$writer->setIndent(true);
$writer->setIndentString(' ');
$writer->startDocument('1.0', Db::getSetting('charset'));
$writer->startElement('urlset');
$writer->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$writer->startElement('url');
$writer->writeElement('loc', Registry::get('root'));
$writer->endElement();
/* process categories */
foreach ($categories as $value) {
$writer->startElement('url');
$writer->writeElement('loc', Registry::get('root') . Registry::get('parameterRoute') . build_route('categories', $value->id));
$writer->writeElement('lastmod', date('c', strtotime($value->date)));
$writer->endElement();
}
/* process articles */
foreach ($articles as $value) {
$writer->startElement('url');
$writer->writeElement('loc', Registry::get('root') . Registry::get('parameterRoute') . build_route('articles', $value->id));
$writer->writeElement('lastmod', date('c', strtotime($value->date)));
$writer->endElement();
}
$writer->endElement();
$writer->endDocument();
return $writer->outputMemory(true);
}
示例3: render
/**
* render the title
*
* @since 3.0.0
*
* @return string
*/
public function render()
{
$title = $this->_registry->get('metaTitle') ? $this->_registry->get('metaTitle') : Db::getSetting('title');
$description = $this->_registry->get('metaDescription') ? $this->_registry->get('metaDescription') : Db::getSetting('description');
$titleElement = new Html\Element();
return $titleElement->init('title')->text($title . Db::getSetting('divider') . $description)->render();
}
示例4: _autorun
/**
* automate run
*
* @since 2.1.0
*/
protected function _autorun()
{
$dbStatus = $this->_registry->get('dbStatus');
$lastTable = $this->_registry->get('lastTable');
$lastId = $this->_registry->get('lastId');
/* detect language */
$this->_detect(['query' => $this->_request->getQuery('l'), 'session' => $this->_request->getSession('language'), 'contents' => $lastTable ? Db::forTablePrefix($lastTable)->where('id', $lastId)->findOne()->language : null, 'settings' => $dbStatus === 2 ? Db::getSetting('language') : null, 'browser' => substr($this->_request->getServer('HTTP_ACCEPT_LANGUAGE'), 0, 2), 'fallback' => 'en'], 'language', 'languages/' . $this->_filePlaceholder . '.json');
}
示例5: _autorun
/**
* automate run
*
* @since 2.1.0
*/
protected function _autorun()
{
$dbStatus = $this->_registry->get('dbStatus');
$lastTable = $this->_registry->get('lastTable');
$lastId = $this->_registry->get('lastId');
$fileInstall = $this->_registry->get('file') === 'install.php';
$partial = $fileInstall ? 'install.phtml' : 'index.phtml';
/* detect template */
$this->_detect(['query' => $this->_request->getQuery('t'), 'session' => $this->_request->getSession('template'), 'contents' => $lastTable ? Db::forTablePrefix($lastTable)->where('id', $lastId)->findOne()->template : null, 'settings' => $dbStatus === 2 ? Db::getSetting('template') : null, 'install' => $fileInstall ? 'install' : null, 'fallback' => 'default'], 'template', 'templates/' . $this->_filePlaceholder . '/' . $partial);
}
示例6: init
/**
* init the class
*
* @since 2.6.0
*
* @param array $optionArray options of the breadcrumb
*/
public function init($optionArray = [])
{
if (is_array($optionArray)) {
$this->_optionArray = array_merge($this->_optionArray, $optionArray);
}
if (!$this->_optionArray['divider']) {
$this->_optionArray['divider'] = Db::getSetting('divider');
}
$this->_create();
}
示例7: _list
/**
* list the settings
*
* @since 3.0.0
*
* @return string
*/
protected function _list()
{
$output = null;
$settings = Db::getSetting();
/* process settings */
foreach ($settings as $setting) {
$output .= str_pad($setting->name, 30) . $setting->value . PHP_EOL;
}
return $output;
}
示例8: sanitize
/**
* sanitize the html
*
* @since 2.4.0
*
* @param string $html target html
* @param boolean $filter optional filter nodes
*
* @return string
*/
public function sanitize($html = null, $filter = true)
{
$charset = Db::getSetting('charset');
$html = mb_convert_encoding($html, 'html-entities', $charset);
$doc = $this->_createDocument($html);
$doc = $this->_cleanDocument($doc);
/* filter nodes */
if ($filter === true) {
$doc = $this->_stripTags($doc);
$doc = $this->_stripAttributes($doc);
$doc = $this->_stripValues($doc);
}
/* collect output */
$output = trim($doc->saveHTML());
return $output;
}
示例9: render
/**
* render the view
*
* @since 3.0.0
*
* @return string
*/
public function render()
{
$output = Hook::trigger('adminSettingFormStart');
/* html elements */
$titleElement = new Html\Element();
$titleElement->init('h2', ['class' => 'rs-admin-title-content']);
$titleElement->text($this->_language->get('settings'));
$formElement = new AdminForm($this->_registry, $this->_language);
$formElement->init(['form' => ['action' => $this->_registry->get('parameterRoute') . 'admin/update/settings', 'class' => 'rs-admin-js-accordion rs-admin-js-validate-form rs-admin-component-accordion rs-admin-form-default rs-admin-fn-clearfix'], 'button' => ['save' => ['name' => 'update']], 'link' => ['cancel' => ['href' => $this->_registry->get('parameterRoute') . 'admin']]]);
/* create the form */
$formElement->append('<fieldset class="rs-admin-js-set-accordion rs-admin-js-set-active rs-admin-set-accordion rs-admin-set-active">')->append('<legend class="rs-admin-js-title-accordion rs-admin-js-title-active rs-admin-title-accordion rs-admin-title-active">' . $this->_language->get('general') . '</legend>')->append('<ul class="rs-admin-js-box-accordion rs-admin-js-box-active rs-admin-box-accordion rs-admin-box-accordion rs-admin-box-active"><li>')->label($this->_language->get('language'), ['for' => 'language'])->select(Helper\Option::getLanguageArray(), ['id' => 'language', 'name' => 'language', 'value' => Db::getSetting('language')])->append('</li><li>')->label($this->_language->get('template'), ['for' => 'template'])->select(Helper\Option::getTemplateArray(), ['id' => 'template', 'name' => 'template', 'value' => Db::getSetting('template')])->append('</li></ul></fieldset>')->append('<fieldset class="rs-admin-js-set-accordion rs-admin-set-accordion">')->append('<legend class="rs-admin-js-title-accordion rs-admin-title-accordion">' . $this->_language->get('metadata') . '</legend>')->append('<ul class="rs-admin-js-box-accordion rs-admin-box-accordion rs-admin-box-accordion"><li>')->label($this->_language->get('title'), ['for' => 'title'])->text(['id' => 'title', 'name' => 'title', 'value' => Db::getSetting('title')])->append('</li><li>')->label($this->_language->get('author'), ['for' => 'author'])->text(['id' => 'author', 'name' => 'author', 'value' => Db::getSetting('author')])->append('</li><li>')->label($this->_language->get('copyright'), ['for' => 'copyright'])->text(['id' => 'copyright', 'name' => 'copyright', 'value' => Db::getSetting('copyright')])->append('</li><li>')->label($this->_language->get('description'), ['for' => 'description'])->textarea(['class' => 'rs-admin-js-auto-resize rs-admin-field-textarea rs-admin-field-small', 'id' => 'description', 'name' => 'description', 'rows' => 1, 'value' => Db::getSetting('description')])->append('</li><li>')->label($this->_language->get('keywords'), ['for' => 'keywords'])->textarea(['class' => 'rs-admin-js-auto-resize rs-admin-field-textarea rs-admin-field-small', 'id' => 'keywords', 'name' => 'keywords', 'rows' => 1, 'value' => Db::getSetting('keywords')])->append('</li><li>')->label($this->_language->get('robots'), ['for' => 'robots'])->select(Helper\Option::getRobotArray(), ['id' => 'robots', 'name' => 'robots', 'value' => filter_var(Db::getSetting('robots'), FILTER_VALIDATE_INT)])->append('</li></ul></fieldset>')->append('<fieldset class="rs-admin-js-set-accordion rs-admin-set-accordion">')->append('<legend class="rs-admin-js-title-accordion rs-admin-title-accordion">' . $this->_language->get('contact') . '</legend>')->append('<ul class="rs-admin-js-box-accordion rs-admin-box-accordion rs-admin-box-accordion"><li>')->label($this->_language->get('email'), ['for' => 'email'])->email(['id' => 'email', 'name' => 'email', 'value' => Db::getSetting('email')])->append('</li><li>')->label($this->_language->get('subject'), ['for' => 'subject'])->text(['id' => 'subject', 'name' => 'subject', 'value' => Db::getSetting('subject')])->append('</li><li>')->label($this->_language->get('notification'), ['for' => 'notification'])->select(Helper\Option::getToggleArray(), ['id' => 'notification', 'name' => 'notification', 'value' => intval(Db::getSetting('notification'))])->append('</li></ul></fieldset>')->append('<fieldset class="rs-admin-js-set-accordion rs-admin-set-accordion">')->append('<legend class="rs-admin-js-title-accordion rs-admin-title-accordion">' . $this->_language->get('formatting') . '</legend>')->append('<ul class="rs-admin-js-box-accordion rs-admin-box-accordion rs-admin-box-accordion"><li>')->label($this->_language->get('charset'), ['for' => 'charset'])->text(['id' => 'charset', 'name' => 'charset', 'value' => Db::getSetting('charset')])->append('</li><li>')->label($this->_language->get('divider'), ['for' => 'divider'])->text(['id' => 'divider', 'name' => 'divider', 'value' => Db::getSetting('divider')])->append('</li><li>')->label($this->_language->get('time'), ['for' => 'time'])->select(Helper\Option::getTimeArray(), ['id' => 'time', 'name' => 'time', 'value' => Db::getSetting('time')])->append('</li><li>')->label($this->_language->get('date'), ['for' => 'date'])->select(Helper\Option::getDateArray(), ['id' => 'date', 'name' => 'date', 'value' => Db::getSetting('date')])->append('</li></ul></fieldset>')->append('<fieldset class="rs-admin-js-set-accordion rs-admin-set-accordion">')->append('<legend class="rs-admin-js-title-accordion rs-admin-title-accordion">' . $this->_language->get('contents') . '</legend>')->append('<ul class="rs-admin-js-box-accordion rs-admin-box-accordion rs-admin-box-accordion"><li>')->label($this->_language->get('homepage'), ['for' => 'homepage'])->select(Helper\Option::getContentArray('articles'), ['id' => 'homepage', 'name' => 'homepage', 'value' => Db::getSetting('homepage')])->append('</li><li>')->label($this->_language->get('limit'), ['for' => 'limit'])->number(['id' => 'limit', 'name' => 'limit', 'value' => Db::getSetting('limit')])->append('</li><li>')->label($this->_language->get('order'), ['for' => 'order'])->select(Helper\Option::getOrderArray(), ['id' => 'order', 'name' => 'order', 'value' => Db::getSetting('order')])->append('</li><li>')->label($this->_language->get('pagination'), ['for' => 'pagination'])->select(Helper\Option::getToggleArray(), ['id' => 'pagination', 'name' => 'pagination', 'value' => intval(Db::getSetting('pagination'))])->append('</li></ul></fieldset>')->append('<fieldset class="rs-admin-js-set-accordion rs-admin-set-accordion">')->append('<legend class="rs-admin-js-title-accordion rs-admin-title-accordion">' . $this->_language->get('users') . '</legend>')->append('<ul class="rs-admin-js-box-accordion rs-admin-box-accordion rs-admin-box-accordion"><li>')->label($this->_language->get('registration'), ['for' => 'registration'])->select(Helper\Option::getToggleArray(), ['id' => 'registration', 'name' => 'registration', 'value' => intval(Db::getSetting('registration'))])->append('</li><li>')->label($this->_language->get('verification'), ['for' => 'verification'])->select(Helper\Option::getToggleArray(), ['id' => 'verification', 'name' => 'verification', 'value' => intval(Db::getSetting('verification'))])->append('</li><li>')->label($this->_language->get('recovery'), ['for' => 'recovery'])->select(Helper\Option::getToggleArray(), ['id' => 'recovery', 'name' => 'recovery', 'value' => intval(Db::getSetting('recovery'))])->append('</li></ul></fieldset>')->append('<fieldset class="rs-admin-js-set-accordion rs-admin-set-accordion">')->append('<legend class="rs-admin-js-title-accordion rs-admin-title-accordion">' . $this->_language->get('security') . '</legend>')->append('<ul class="rs-admin-js-box-accordion rs-admin-box-accordion rs-admin-box-accordion"><li>')->label($this->_language->get('moderation'), ['for' => 'moderation'])->select(Helper\Option::getToggleArray(), ['id' => 'moderation', 'name' => 'moderation', 'value' => intval(Db::getSetting('moderation'))])->append('</li><li>')->label($this->_language->get('captcha'), ['for' => 'captcha'])->select(Helper\Option::getCaptchaArray(), ['id' => 'captcha', 'name' => 'captcha', 'value' => intval(Db::getSetting('captcha'))])->append('</li></ul></fieldset>')->token()->cancel()->save();
/* collect output */
$output .= $titleElement . $formElement;
$output .= Hook::trigger('adminSettingFormEnd');
return $output;
}
示例10: render
/**
* render the view
*
* @since 3.0.0
*
* @param array $resultArray array for the result
*
* @return string
*/
public function render($resultArray = [])
{
$output = Hook::trigger('resultListStart');
$accessValidator = new Validator\Access();
/* html elements */
$titleElement = new Html\Element();
$titleElement->init('h2', ['class' => 'rs-title-result']);
$listElement = new Html\Element();
$listElement->init('ol', ['class' => 'rs-list-result']);
$itemElement = new Html\Element();
$itemElement->init('li');
$linkElement = new Html\Element();
$linkElement->init('a', ['class' => 'rs-link-result']);
$textElement = new Html\Element();
$textElement->init('span', ['class' => 'rs-text-result-date']);
/* process result */
foreach ($resultArray as $table => $result) {
$outputItem = null;
if ($result) {
/* collect item output */
foreach ($result as $value) {
if ($accessValidator->validate($result->access, $this->_registry->get('myGroups')) === Validator\ValidatorInterface::PASSED) {
$textDate = date(Db::getSetting('date'), strtotime($value->date));
$linkElement->attr('href', $this->_registry->get('parameterRoute') . build_route($table, $value->id))->text($value->title ? $value->title : $value->author);
$textElement->text($textDate);
$outputItem .= $itemElement->html($linkElement . $textElement);
}
}
/* collect output */
if ($outputItem) {
$titleElement->text($this->_language->get($table));
$listElement->html($outputItem);
$output .= $titleElement . $listElement;
}
}
}
$output .= Hook::trigger('resultListEnd');
return $output;
}
示例11: render
/**
* render the view
*
* @since 3.0.0
*
* @param integer $articleId identifier of the article
*
* @return string
*/
public function render($articleId = null)
{
$output = Hook::trigger('commentFormStart');
/* html elements */
$titleElement = new Html\Element();
$titleElement->init('h2', ['class' => 'rs-title-content'])->text($this->_language->get('comment_new'));
$formElement = new Html\Form($this->_registry, $this->_language);
$formElement->init(['button' => ['submit' => ['name' => get_class()]]], ['captcha' => Db::getSetting('captcha') > 0]);
/* create the form */
$formElement->append('<fieldset>')->legend()->append('<ul><li>')->label('* ' . $this->_language->get('author'), ['for' => 'author'])->text(['id' => 'author', 'name' => 'author', 'readonly' => $this->_registry->get('myName') ? 'readonly' : null, 'required' => 'required', 'value' => $this->_registry->get('myName')])->append('</li><li>')->label('* ' . $this->_language->get('email'), ['for' => 'email'])->email(['id' => 'email', 'name' => 'email', 'readonly' => $this->_registry->get('myEmail') ? 'readonly' : null, 'required' => 'required', 'value' => $this->_registry->get('myEmail')])->append('</li><li>')->label($this->_language->get('url'), ['for' => 'url'])->url(['id' => 'url', 'name' => 'url'])->append('</li><li>')->label('* ' . $this->_language->get('text'), ['for' => 'text'])->textarea(['class' => 'rs-js-auto-resize rs-js-editor-textarea rs-field-textarea', 'id' => 'text', 'name' => 'text', 'required' => 'required'])->append('</li>');
if (Db::getSetting('captcha') > 0) {
$formElement->append('<li>')->captcha('task')->append('</li>');
}
$formElement->append('</ul></fieldset>');
if (Db::getSetting('captcha') > 0) {
$formElement->captcha('solution');
}
$formElement->hidden(['name' => 'article', 'value' => $articleId])->token()->submit()->reset();
/* collect output */
$output .= $titleElement . $formElement;
$output .= Hook::trigger('commentFormEnd');
return $output;
}
示例12: render
/**
* render the view
*
* @since 3.0.0
*
* @return string
*/
public function render()
{
$output = Hook::trigger('recoverFormStart');
/* html elements */
$titleElement = new Html\Element();
$titleElement->init('h2', ['class' => 'rs-title-content'])->text($this->_language->get('recovery'));
$formElement = new Html\Form($this->_registry, $this->_language);
$formElement->init(['form' => ['class' => 'rs-js-validate-form rs-form-default rs-form-recover'], 'button' => ['submit' => ['name' => get_class()]]], ['captcha' => Db::getSetting('captcha') > 0]);
/* create the form */
$formElement->append('<fieldset>')->legend($this->_language->get('recovery_request') . $this->_language->get('point'))->append('<ul><li>')->label('* ' . $this->_language->get('email'), ['for' => 'email'])->email(['autofocus' => 'autofocus', 'id' => 'email', 'name' => 'email', 'required' => 'required'])->append('</li>');
if (Db::getSetting('captcha') > 0) {
$formElement->append('<li>')->captcha('task')->append('</li>');
}
$formElement->append('</ul></fieldset>');
if (Db::getSetting('captcha') > 0) {
$formElement->captcha('solution');
}
$formElement->token()->submit();
/* collect output */
$output .= $titleElement . $formElement;
$output .= Hook::trigger('recoverFormEnd');
return $output;
}
示例13: _mail
/**
* send the mail
*
* @since 3.0.0
*
* @param array $mailArray
*
* @return boolean
*/
protected function _mail($mailArray = [])
{
/* html elements */
$linkElement = new Html\Element();
$linkElement->init('a', ['href' => $this->_registry->get('root')])->text($this->_registry->get('root'));
/* prepare mail */
$toArray = [$mailArray['adminName'] => $mailArray['adminEmail']];
$fromArray = [Db::getSetting('author') => Db::getSetting('email')];
$subject = $this->_language->get('installation');
$bodyArray = ['<strong>' . $this->_language->get('user') . $this->_language->get('colon') . '</strong> ' . $mailArray['adminUser'], '<br />', '<strong>' . $this->_language->get('password') . $this->_language->get('colon') . '</strong> ' . $mailArray['adminPassword'], '<br />', '<strong>' . $this->_language->get('url') . $this->_language->get('colon') . '</strong> ' . $linkElement];
/* send mail */
$mailer = new Mailer();
$mailer->init($toArray, $fromArray, $subject, $bodyArray);
return $mailer->send();
}
示例14: _mail
/**
* mail
*
* @since 3.0.0
*
* @param array $mailArray
*
* @return boolean
*/
protected static function _mail($mailArray = [])
{
$toArray = [Db::getSetting('author') => Db::getSetting('email')];
$fromArray = [$mailArray['author'] => $mailArray['email']];
$subject = Language::get('contact');
$bodyArray = [Language::get('author') . Language::get('colon') . ' ' . $mailArray['author'], '<br />', Language::get('email') . Language::get('colon') . ' <a href="mailto:' . $mailArray['email'] . '">' . $mailArray['email'] . '</a>', '<br />', Language::get('url') . Language::get('colon') . ' <a href="' . $mailArray['url'] . '">' . $mailArray['url'] . '</a>', '<br />', Language::get('message') . Language::get('colon') . ' ' . $mailArray['text']];
/* send mail */
$mailer = new Mailer();
$mailer->init($toArray, $fromArray, $subject, $bodyArray);
return $mailer->send();
}
示例15: _mail
/**
* send the mail
*
* @since 3.0.0
*
* @param array $mailArray
*
* @return boolean
*/
protected function _mail($mailArray = [])
{
$urlLogin = $this->_registry->get('root') . '/' . $this->_registry->get('parameterRoute') . 'login';
/* html elements */
$linkElement = new Html\Element();
$linkElement->init('a', ['href' => $urlLogin])->text($urlLogin);
/* prepare mail */
$toArray = [$mailArray['name'] => $mailArray['email'], Db::getSetting('author') => Db::getSetting('notification') ? Db::getSetting('email') : null];
$fromArray = [$mailArray['name'] => $mailArray['email']];
$subject = $this->_language->get('registration');
$bodyArray = ['<strong>' . $this->_language->get('name') . $this->_language->get('colon') . '</strong> ' . $mailArray['name'], '<br />', '<strong>' . $this->_language->get('user') . $this->_language->get('colon') . '</strong> ' . $mailArray['user'], '<br />', '<strong>' . $this->_language->get('password') . $this->_language->get('colon') . '</strong> ' . $mailArray['password'], '<br />', '<strong>' . $this->_language->get('login') . $this->_language->get('colon') . '<strong> ' . $linkElement];
/* send mail */
$mailer = new Mailer();
$mailer->init($toArray, $fromArray, $subject, $bodyArray);
return $mailer->send();
}