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


PHP _ws函数代码示例

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


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

示例1: getHtml

    public function getHtml($error = null)
    {
        $captcha_url = wa()->getRootUrl(false, true) . $this->getAppId() . '/captcha.php?rid=' . uniqid(time());
        $refresh = _ws("Refresh CAPTCHA");
        $class = $error ? ' wa-error' : '';
        return <<<HTML
<div class="wa-captcha">
    <p>
        <img class="wa-captcha-img" src="{$captcha_url}" alt="CAPTCHA" title="{$refresh}">
        <strong>&rarr;</strong>
        <input type="text" name="captcha" class="wa-captcha-input{$class}" autocomplete="off">
    </p>
    <p>
        <a href="#" class="wa-captcha-refresh">{$refresh}</a>
    </p>
    <script type="text/javascript">
    \$(function() {
        \$('div.wa-captcha .wa-captcha-refresh, div.wa-captcha .wa-captcha-img').click(function(){
            var div = \$(this).parents('div.wa-captcha');
            var captcha = div.find('.wa-captcha-img');
            if(captcha.length) {
                captcha.attr('src', captcha.attr('src').replace(/\\?.*\$/,'?rid='+Math.random()));
                captcha.one('load', function() {
                    div.find('.wa-captcha-input').focus();
                });
            };
            return false;
        });
    });
    </script>
</div>
HTML;
    }
开发者ID:nowaym,项目名称:webasyst-framework,代码行数:33,代码来源:waCaptcha.class.php

示例2: execute

 public function execute()
 {
     if (!$this->getUser()->getRights('shop', 'settings')) {
         throw new waException(_w('Access denied'));
     }
     $plugin_id = waRequest::get('id');
     if (!$plugin_id) {
         throw new waException(_ws("Can't save plugin settings: unknown plugin id"));
     }
     $namespace = 'shop_' . $plugin_id;
     /**
      * @var shopPlugin $plugin
      */
     $plugin = waSystem::getInstance()->getPlugin($plugin_id);
     $settings = (array) $this->getRequest()->post($namespace);
     $files = waRequest::file($namespace);
     $settings_defenitions = $plugin->getSettings();
     foreach ($files as $name => $file) {
         if (isset($settings_defenitions[$name])) {
             $settings[$name] = $file;
         }
     }
     try {
         $this->response = $plugin->saveSettings($settings);
         $this->response['message'] = _w('Saved');
     } catch (Exception $e) {
         $this->setError($e->getMessage());
     }
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:29,代码来源:shopPluginsSave.controller.php

示例3: execute

 public function execute()
 {
     $e = $this->getRequest()->param('exception');
     if ($e && $e instanceof Exception) {
         /**
          * @var Exception $e
          */
         $code = $e->getCode();
         if (!$code) {
             $code = 500;
         }
         $message = $e->getMessage();
     } else {
         $code = 404;
         $message = _ws("Page not found");
     }
     $this->getResponse()->setStatus($code);
     $this->getResponse()->setTitle(htmlentities($code . '. ' . $message, ENT_QUOTES, 'utf-8'));
     $this->view->assign('error_code', $code);
     $this->view->assign('error_message', $message);
     if ($code == 404) {
         $this->setLayout(new blogFrontendLayout());
     }
     $this->setThemeTemplate('error.html', waRequest::param('theme', 'default'));
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:25,代码来源:blogFrontendError.action.php

示例4: execute

 public function execute()
 {
     parent::execute();
     $this->view->assign('my_nav_selected', 'profile');
     $user = wa()->getUser();
     $user_info = array();
     foreach ($this->form->fields as $id => $field) {
         if (!in_array($id, array('password', 'password_confirm'))) {
             if ($id === 'photo') {
                 $user_info[$id] = array('name' => _ws('Photo'), 'value' => '<img src="' . $user->getPhoto() . '">');
             } else {
                 $user_info[$id] = array('name' => $this->form->fields[$id]->getName(null, true), 'value' => $user->get($id, 'html'));
             }
         }
     }
     $this->view->assign('user_info', $user_info);
     // Set up layout and template from theme
     $this->setThemeTemplate('my.profile.html');
     if (!waRequest::isXMLHttpRequest()) {
         $this->setLayout(new photosDefaultFrontendLayout());
         $this->getResponse()->setTitle(_w('My account') . ' — ' . _w('My profile'));
         $this->layout->assign('breadcrumbs', $this->getBreadcrumbs());
         $this->layout->assign('nofollow', true);
     }
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:25,代码来源:photosFrontendMy.action.php

示例5: execute

 public function execute()
 {
     if (!$this->appSettings('show_comments', true)) {
         throw new waException(_ws("Page not found"), 404);
     }
     $this->comment_model = new blogCommentModel();
     $this->blog_id = waRequest::param('blog_id', false, waRequest::TYPE_ARRAY_INT);
     $this->verify();
     if ($this->getRequest()->method() == 'post') {
         $res = $this->addComment();
     } else {
         $this->comment_id = waRequest::param('blog_id', false, waRequest::TYPE_ARRAY_INT);
         $res = true;
     }
     if (waRequest::get('json')) {
         if ($this->comment_id) {
             $this->displayComment();
         }
     } else {
         if (!$res) {
             var_export($this->errors);
             exit;
             //handle error on non ajax
         }
         $url = blogPost::getUrl($this->post) . '#comment' . intval($this->parent_id ? $this->parent_id : $this->comment_id);
         $this->redirect($url);
     }
 }
开发者ID:Favorskij,项目名称:webasyst-framework,代码行数:28,代码来源:blogFrontendComment.controller.php

示例6: saveAction

 public function saveAction()
 {
     $plugin_id = waRequest::get('id');
     if (!$plugin_id) {
         throw new waException(_ws("Can't save plugin settings: unknown plugin id"));
     }
     $namespace = $this->getAppId() . '_' . $plugin_id;
     /**
      * @var shopPlugin $plugin
      */
     $plugin = waSystem::getInstance()->getPlugin($plugin_id);
     $settings = (array) $this->getRequest()->post($namespace);
     $files = waRequest::file($namespace);
     $settings_defenitions = $plugin->getSettings();
     foreach ($files as $name => $file) {
         if (isset($settings_defenitions[$name])) {
             $settings[$name] = $file;
         }
     }
     try {
         $response = $plugin->saveSettings($settings);
         $response['message'] = _w('Saved');
         $this->displayJson($response);
     } catch (Exception $e) {
         $this->setError($e->getMessage());
         $this->displayJson(array(), $e->getMessage());
     }
 }
开发者ID:Rupreht,项目名称:webasyst-framework,代码行数:28,代码来源:waPlugins.actions.php

示例7: execute

 public function execute()
 {
     // Layout caching is forbidden
     header("Cache-Control: no-store, no-cache, must-revalidate");
     header("Expires: " . date("r"));
     $this->executeAction('sidebar', new contactsBackendSidebarAction());
     $fields = array();
     // normally this is done with waContactFields::getInfo() but we don't need most of the info
     // so we loop through fields manually.
     foreach (waContactFields::getAll('enabled') as $field_id => $f) {
         /**
          * @var $f waContactField
          */
         $fields[$field_id] = array();
         $fields[$field_id]['id'] = $field_id;
         $fields[$field_id]['name'] = $f->getName();
         $fields[$field_id]['fields'] = $f instanceof waContactCompositeField;
         if ($ext = $f->getParameter('ext')) {
             $fields[$field_id]['ext'] = $ext;
             foreach ($fields[$field_id]['ext'] as &$v) {
                 $v = _ws($v);
             }
         }
     }
     // Plugin assets
     if ($this->getConfig()->getInfo('edition') === 'full') {
         wa()->event('assets');
     }
     $this->view->assign('admin', wa()->getUser()->getRights('contacts', 'backend') > 1);
     $this->view->assign('global_admin', wa()->getUser()->getRights('webasyst', 'backend') > 0);
     $this->view->assign('fields', $fields);
     $this->view->assign('versionFull', $this->getConfig()->getInfo('edition') === 'full');
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:33,代码来源:contactsDefault.layout.php

示例8: __construct

 public function __construct()
 {
     // check access rights
     if (!$this->getRights('design')) {
         throw new waRightsException(_ws("Access denied"));
     }
 }
开发者ID:cjmaximal,项目名称:webasyst-framework,代码行数:7,代码来源:guestbook2Design.actions.php

示例9: init

 public function init()
 {
     $this->addItem('upload', _w('Can upload photos and create new albums'));
     $this->addItem('edit', _w('Can edit and delete photos and albums uploaded by other users'));
     $this->addItem('pages', _ws('Can edit pages'));
     $this->addItem('design', _ws('Can edit design'));
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:7,代码来源:photosRightConfig.class.php

示例10: init

 public function init()
 {
     // Право удалять записи
     $this->addItem('delete', 'Can delete posts', 'checkbox');
     // Право редактировать дизайн (шаблоны и темы)
     $this->addItem('design', _ws('Can edit design'), 'checkbox');
 }
开发者ID:nowaym,项目名称:webasyst-framework,代码行数:7,代码来源:guestbook2RightConfig.class.php

示例11: execute

 public function execute()
 {
     $plugin_id = waRequest::get('id');
     if (!$plugin_id) {
         throw new waException(_ws("Can't save plugin settings: unknown plugin id"));
     }
     $namespace = 'photos_' . $plugin_id;
     /**
      * @var photosPlugin $plugin
      */
     $plugin = waSystem::getInstance()->getPlugin($plugin_id);
     $settings = (array) $this->getRequest()->post($namespace);
     $files = waRequest::file($namespace);
     $settings_defenitions = $plugin->getSettings();
     foreach ($files as $name => $file) {
         if (isset($settings_defenitions[$name])) {
             $settings[$name] = $file;
         }
     }
     try {
         $plugin->saveSettings($settings);
     } catch (Exception $e) {
         $this->errors = $e->getMessage();
     }
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:25,代码来源:photosPluginsSave.controller.php

示例12: getDelimiters

 public static function getDelimiters()
 {
     $result = array();
     foreach (self::$delimiters as $k => $d) {
         $result[$k] = array($d[0], _ws($d[1]));
     }
     return $result;
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:8,代码来源:waCSV.class.php

示例13: getMessage

 public function getMessage($name, $variables = array())
 {
     $message = isset($this->messages[$name]) ? $this->messages[$name] : _ws('Invalid');
     foreach ($variables as $k => $v) {
         $message = str_replace('%' . $k . '%', $v, $message);
     }
     return $message;
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:8,代码来源:waValidator.class.php

示例14: init

 public function init()
 {
     if (!isset($this->options['validators'])) {
         $options = $this->options;
         $options['required'] = true;
         $this->options['validators'] = new waStringValidator($options, array('required' => _ws('At least one of these fields must be filled')));
     }
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:8,代码来源:waContactNameField.class.php

示例15: execute

 public function execute()
 {
     $filepath = wa()->getCachePath('plugins/discountcards/export-discountcards.csv', 'shop');
     if (!file_exists($filepath)) {
         throw new waException(_ws("Page not found"), 404);
     }
     waFiles::readFile($filepath, 'export-discountcards.csv');
 }
开发者ID:klxqz,项目名称:discountcards,代码行数:8,代码来源:shopDiscountcardsPluginDownload.controller.php


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