• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Am_Controller类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: process

 public function process(Am_Controller $action = null)
 {
     $action->view->url = $this->getURL();
     $action->view->vars = $this->getVars();
     $action->render('payment', '', true);
     throw new Am_Exception_Redirect($this->getURL());
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:7,代码来源:Form.php


示例2: process

 public function process(Am_Controller $action = null)
 {
     $action->view->addBasePath($this->_path);
     $action->view->assign($this->getVars());
     $action->renderScript($this->_template);
     throw new Am_Exception_Redirect();
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:7,代码来源:netdebits.php


示例3: process

 public function process(Am_Controller $controller = null)
 {
     if ($controller === null) {
         Am_Controller::redirectLocation($this->getUrl());
     } else {
         $controller->redirectLocation($this->getUrl());
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:8,代码来源:Redirect.php


示例4: _initSetupForm

 protected function _initSetupForm(Am_Form_Setup $form)
 {
     $url = 'https://auth.aweber.com/1.0/oauth/authorize_app/' . self::APP_ID;
     $el = $form->addTextarea('auth', array('cols' => 80, 'rows' => 4))->setLabel("aWeber App Authorization Code\n" . "get it on <a target='_blank' href='{$url}'>aWeber Website</a>");
     $el->addRule('regex', 'Invalid value', '/^[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|\\s*$/');
     if ($this->getConfig('auth') && !$this->getConfig('access.access_token')) {
         if (!empty($_GET['oauth_token'])) {
             $api = $this->getApi();
             $api->user->tokenSecret = $_COOKIE['requestTokenSecret'];
             $api->user->requestToken = $_GET['oauth_token'];
             $api->user->verifier = $_GET['oauth_verifier'];
             list($accessToken, $accessTokenSecret) = $api->getAccessToken();
             $this->getDi()->config->saveValue('newsletter.aweber.access', array('access_token' => $accessToken, 'access_secret' => $accessTokenSecret));
             Am_Controller::redirectLocation(REL_ROOT_URL . "/admin-setup/aweber");
             return;
         } else {
             $api = $this->getApi();
             $callbackUrl = Am_Controller::getFullUrl();
             try {
                 list($requestToken, $requestTokenSecret) = $api->getRequestToken($callbackUrl);
                 Am_Controller::setCookie('requestTokenSecret', $requestTokenSecret);
                 $form->addStatic()->setLabel('Access Tokens')->setContent(sprintf('Access tokens are empty or expired, %sclick this link%s to update', '<a href="' . Am_Controller::escape($api->getAuthorizeUrl()) . '">', '</a>'));
             } catch (Exception $e) {
                 $this->getDi()->errorLogTable->logException($e);
                 $form->addStatic()->setLabel('Access Tokens')->setContent('Plugin configuration error. Got an error from API: ' . $e->getMessage());
             }
         }
     }
     $fields = $this->getDi()->userTable->getFields(true);
     unset($fields['email']);
     unset($fields['name_f']);
     unset($fields['name_l']);
     $ff = $form->addMagicSelect('fields')->setLabel("Pass additional fields to AWeber\nfields must be configured in AWeber with exactly same titles\nelse API calls will fail and users will not be added\n\nBy default the plugin passes \"email\" and \"name\"\nfields to Aweber, so usually you do not need to select \nthat fields to send as additional fields.\n");
     $ff->loadOptions(array_combine($fields, $fields));
 }
开发者ID:grlf,项目名称:eyedock,代码行数:35,代码来源:aweber.php


示例5: infoTabEcheckAction

 function infoTabEcheckAction()
 {
     require_once APPLICATION_PATH . '/default/controllers/AdminUsersController.php';
     $this->setActiveMenu('users-browse');
     $user_id = $this->_request->getInt('user_id');
     if (!$user_id) {
         throw Am_Exception_InputError("Empty [user_id] passsed");
     }
     $echeck = $this->getDi()->echeckRecordTable->findFirstByUserId($user_id);
     $this->view->echeck = $echeck;
     $this->view->addUrl = $this->getUrl(null, null, null, 'user_id', $this->getInt('user_id'), array('add' => 1));
     if ($echeck || $this->_request->getInt('add') || $this->_request->get('_save_')) {
         $form = $this->createEcheckAdminForm((bool) $echeck);
         if ($form) {
             if ($form->isSubmitted() && $form->validate()) {
                 if (!$echeck) {
                     $echeck = $this->getDi()->echeckRecordTable->createRecord();
                 }
                 $form->toEcheckRecord($echeck);
                 $echeck->user_id = $user_id;
                 $echeck->save();
                 Am_Controller::redirectLocation($this->_request->getRequestUri());
             } elseif ($echeck) {
                 $arr = $echeck->toArray();
                 unset($arr['echeck_ban']);
                 $form->addDataSource(new HTML_QuickForm2_DataSource_Array($arr));
             }
             $this->view->form = $form;
             $this->view->form->setAction($this->_request->getRequestUri());
         }
     }
     $this->view->display('admin/echeck/info-tab.phtml');
     // ????
 }
开发者ID:grlf,项目名称:eyedock,代码行数:34,代码来源:AdminController.php


示例6: folderAction

 function folderAction()
 {
     $id = $this->_request->getInt('id');
     if (!$id) {
         throw new Am_Exception_InputError("Empty folder#");
     }
     $folder = $this->getDi()->folderTable->load($id);
     if (empty($folder)) {
         throw new Am_Exception_InputError("Folder not found");
     }
     // Check if login cookie exists. If not, user is not logged in and should be redirected to login page.
     $pl = $this->getDi()->plugins_protect->loadGet('new-rewrite');
     // User will be there only if file related to folder doesn't exists.
     // So if main file exists, this means that user is logged in but don't have an access.
     // If main file doesn't exists, redirect user to new-rewrite in order to recreate it.
     // Main file will be created even if user is not active.
     if (is_file($pl->getFilePath($pl->getEscapedCookie()))) {
         $this->view->accessObjectTitle = ___("Folder %s (%s)", $folder->title, $folder->url);
         $this->view->orderUrl = REL_ROOT_URL . '/signup';
         $this->view->display('no-access.phtml');
     } else {
         $url = sprintf("%s/protect/new-rewrite?f=%d&url=%s", REL_ROOT_URL, $id, $this->_request->getParam('url', $folder->getUrl()));
         Am_Controller::redirectLocation($url);
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:25,代码来源:NoAccessController.php


示例7: _process

 public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
 {
     $req = new Am_HttpRequest(sprintf('https://gateway-japa.americanexpress.com/api/rest/version/23/merchant/%s/session', $this->getConfig('merchant')), Am_HttpRequest::METHOD_POST);
     $req->setAuth('merchant.' . $this->getConfig('merchant'), $this->getConfig('password'));
     $req->setBody(Am_Controller::getJson(array('apiOperation' => 'CREATE_PAYMENT_PAGE_SESSION', 'order' => array('id' => $invoice->public_id, 'amount' => $invoice->first_total, 'currency' => $invoice->currency), 'paymentPage' => array('cancelUrl' => $this->getCancelUrl(), 'returnUrl' => $this->getPluginUrl('thanks')))));
     $this->logRequest($req);
     $res = $req->send();
     $this->logResponse($res);
     if ($res->getStatus() != 201) {
         $result->setFailed(sprintf('Incorrect Responce Status From Paysystem [%s]', $res->getStatus()));
         return;
     }
     $msg = Am_Controller::decodeJson($res->getBody());
     if ($msg['result'] == 'ERROR') {
         $result->setFailed($msg['error']['explanation']);
         return;
     }
     $invoice->data()->set(self::DATA_KEY, $msg['successIndicator'])->update();
     $a = new Am_Paysystem_Action_Redirect(self::URL);
     $a->{'merchant'} = $this->getConfig('merchant');
     $a->{'order.description'} = $invoice->getLineDescription();
     $a->{'paymentPage.merchant.name'} = $this->getDi()->config->get('site_title');
     $a->{'session.id'} = $msg['session']['id'];
     $this->logRequest($a);
     $result->setAction($a);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:26,代码来源:amex-hpp.php


示例8: _afterInitSetupForm

    function _afterInitSetupForm(Am_Form_Setup $form)
    {
        $url = Am_Controller::escape(REL_ROOT_URL) . '/default/admin-content/p/newsletter/index';
        $text = ___("Once the plugin configuration is finished on this page, do not forget to add\n" . "a record on %saMember CP -> Protect Content -> Newsletters%s page", '<a href="' . $url . '" target="_blank" class="link">', '</a>');
        $form->addProlog(<<<CUT
<div class="warning_box">
    {$text}
</div>
CUT
);
        if ($this->canGetLists()) {
            $lists = array();
            try {
                foreach ($this->getLists() as $k => $v) {
                    $lists[$k] = $v['title'];
                }
            } catch (Exception $e) {
                //just log
                $this->getDi()->errorLogTable->logException($e);
            }
            $gr = $form->addGroup()->setLabel(___('Unsubscribe customer from selected newsletter threads'));
            $gr->addSelect('unsubscribe_after_signup')->loadOptions(array('' => ___('Please Select'), self::UNSUBSCRIBE_AFTER_ADDED => ___('After the user has been added'), self::UNSUBSCRIBE_AFTER_PAID => ___('After first payment has been completed')));
            $gr->addStatic()->setContent('<br><br>');
            $gr->addMagicSelect('unsubscribe_after_signup_lists')->loadOptions($lists);
        }
        parent::_afterInitSetupForm($form);
    }
开发者ID:grlf,项目名称:eyedock,代码行数:27,代码来源:Plugin.php


示例9: getWrapper

 protected function getWrapper($obj, $grid)
 {
     $id = $this->action->getIdForRecord($obj);
     list($url, $params) = $this->divideUrlAndParams($this->action->getUrl($obj, $id));
     $start = sprintf("<span class='live-edit' id='%s' livetemplate='%s' liveurl='%s' livedata='%s' placeholder='%s'>", $grid->getId() . '_' . $this->field->getFieldName() . '-' . $grid->escape($id), $grid->escape($this->getInputTemplate()), $url, Am_Controller::getJson($params), $grid->escape($this->action->getPlaceholder()));
     $stop = '</span>';
     return array($start, $stop);
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:8,代码来源:LiveEdit.php


示例10: getContent

 protected function getContent($obj, Am_Grid_Editable $grid)
 {
     $id = $this->action->getIdForRecord($obj);
     $val = $obj->{$this->field->getFieldName()};
     list($url, $params) = $this->divideUrlAndParams($this->action->getUrl($obj, $id));
     $content = sprintf('<input name="%s" class="live-checkbox" data-url="%s" data-id="%d" data-params="%s" data-value="%s" data-empty_value="%s" type="checkbox" %s/>', Am_Controller::escape($grid->getId() . '_' . $this->field->getFieldName() . '-' . $grid->escape($id)), Am_Controller::escape($url), $id, Am_Controller::escape(Am_Controller::getJson($params)), Am_Controller::escape($this->action->getValue()), Am_Controller::escape($this->action->getEmptyValue()), $val == $this->action->getValue() ? 'checked ' : '');
     return $content;
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:8,代码来源:LiveCheckbox.php


示例11: renderInputs

 public function renderInputs()
 {
     $gridId = $this->grid->getId();
     $options = array_merge(array('' => ''), Am_Currency::getSupportedCurrencies());
     array_remove_value($options, Am_Currency::getDefault());
     $filter = $this->getParam('filter');
     return sprintf("<select name='{$gridId}_filter[currency]'>\n%s\n</select>\n", Am_Controller::renderOptions($options, @$filter['currency']));
 }
开发者ID:grlf,项目名称:eyedock,代码行数:8,代码来源:AdminCurrencyExchangeController.php


示例12: renderTable

 function renderTable($kvRows)
 {
     $h = "<table class='logdetail'>\n";
     foreach ($kvRows as $k => $v) {
         $h .= sprintf("<tr><th>%s</th><td>%s</td></tr>\n", Am_Controller::escape($k), Am_Controller::escape($v));
     }
     $h .= "</table>\n";
     return $h;
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:9,代码来源:InvoiceLog.php


示例13: renderLink

 public function renderLink(ResourceAbstract $resource)
 {
     $html = "";
     $url = $resource->getUrl();
     if (!empty($url)) {
         $html = sprintf('<a href="%s" target="_blank">%s</a>', Am_Controller::escape($url), ___('link'));
     }
     return $this->renderTd($html, false);
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:9,代码来源:Content.php


示例14: directAction

 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     $user = $this->getDi()->user;
     $id = $this->getDi()->app->reveal($request->getActionName());
     //actualy it is notification_id
     $notification = $this->getDi()->notificationTable->load($id);
     $this->getDi()->notificationClickTable->log($user, $notification);
     Am_Controller::redirectLocation($notification->url);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:9,代码来源:notification.php


示例15: getWrapper

 protected function getWrapper($obj, $grid)
 {
     $id = $this->action->getIdForRecord($obj);
     $val = $obj->{$this->field->getFieldName()};
     list($url, $params) = $this->divideUrlAndParams($this->action->getUrl($obj, $id));
     $start = sprintf('<span class="live-edit%s" id="%s" livetemplate="%s" liveurl="%s" livedata="%s" placeholder="%s" data-init-callback="%s">', $val ? '' : ' live-edit-placeholder', $grid->getId() . '_' . $this->field->getFieldName() . '-' . $grid->escape($id), $grid->escape($this->getInputTemplate()), $url, $grid->escape(Am_Controller::getJson($params)), $grid->escape($this->action->getPlaceholder()), $grid->escape($this->action->getInitCallback()));
     $stop = '</span>';
     return array($start, $stop);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:9,代码来源:LiveEdit.php


示例16: getReadme

    public function getReadme()
    {
        $ipn = Am_Controller::escape($this->getPluginUrl('ipn'));
        return <<<CUT
You need to enable 'Direct HTTP server-to-server request' on page 'Configuration -> Technical Information -> Transaction Feedback' in your ePDQ account
and set it to
<strong>{$ipn}</strong>
CUT;
    }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:9,代码来源:epdq.php


示例17: directAction

 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     if ('reject' == $request->getActionName()) {
         $invoice = $this->getDi()->invoiceTable->findFirstByPublicId($request->get("orderDescription"));
         $url = $this->getRootUrl() . "/cancel?id=" . $invoice->getSecureId('CANCEL');
         return Am_Controller::redirectLocation($url);
     } else {
         return parent::directAction($request, $response, $invokeArgs);
     }
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:10,代码来源:ipaydna.php


示例18: initActions

 function initActions()
 {
     $this->actionAdd(new Am_Grid_Action_Upload());
     $this->actionAdd(new Am_Grid_Action_Delete());
     $actionDownload = new Am_Grid_Action_Url('download', 'Download', Am_Controller::makeUrl('admin-upload', 'get', 'default', array('id' => '__ID__')));
     $actionDownload->setTarget('_top');
     $this->actionAdd($actionDownload);
     $this->actionAdd(new Am_Grid_Action_Group_Delete());
     $this->actionAdd(new Am_Grid_Action_LiveEdit('desc'));
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:10,代码来源:AdminBannersController.php


示例19: process

 /**
  * This function is likely never returns
  * but anyway handle result and exceptions
  * @return Am_Paysystem_Result
  */
 function process()
 {
     Am_Di::getInstance()->hook->call(Am_Event::INVOICE_BEFORE_PAYMENT, array('invoice' => $this->invoice, 'controller' => $this->controller));
     $plugin = Am_Di::getInstance()->plugins_payment->loadGet($this->invoice->paysys_id);
     $this->result = new Am_Paysystem_Result();
     $plugin->processInvoice($this->invoice, $this->controller->getRequest(), $this->result);
     if ($this->result->isSuccess() || $this->result->isFailure()) {
         if ($transaction = $this->result->getTransaction()) {
             $transaction->setInvoice($this->invoice);
             $transaction->process();
         }
     }
     if ($this->result->isSuccess()) {
         if (method_exists($this->controller, 'getForm')) {
             $this->controller->getForm()->getSessionContainer()->destroy();
         }
         $url = REL_ROOT_URL . "/thanks?id=" . $this->invoice->getSecureId('THANKS');
         $this->callback($this->onSuccess);
         $this->controller->redirectLocation($url);
         // no return
         // Am_Exception_Redirect only for APPLICATION_ENV = 'testing'
     } elseif ($this->result->isAction()) {
         if (method_exists($this->controller, 'getForm')) {
             $this->controller->getForm()->getSessionContainer()->destroy();
         }
         $this->callback($this->onAction);
         $this->result->getAction()->process($this->controller);
         // no return
         // Am_Exception_Redirect only for APPLICATION_ENV = 'testing'
     } else {
         //  ($result->isFailure()) {
         $this->callback($this->onFailure);
     }
     return $this->result;
 }
开发者ID:irovast,项目名称:eyedock,代码行数:40,代码来源:PayProcessMediator.php


示例20: process

 /**
  * This function is likely never returns
  * but anyway handle result and exceptions
  * @return Am_Paysystem_Result
  */
 function process()
 {
     $err = $this->invoice->validate();
     if ($err) {
         throw new Am_Exception_InputError($err[0]);
     }
     $this->invoice->save();
     $plugin = Am_Di::getInstance()->plugins_payment->loadGet($this->invoice->paysys_id);
     $this->result = new Am_Paysystem_Result();
     $plugin->processInvoice($this->invoice, $this->controller->getRequest(), $this->result);
     if ($this->result->isSuccess() || $this->result->isFailure()) {
         if ($transaction = $this->result->getTransaction()) {
             $transaction->setInvoice($this->invoice);
             $transaction->process();
         }
     }
     if ($this->result->isSuccess()) {
         $url = REL_ROOT_URL . "/thanks?id=" . $this->invoice->getSecureId('THANKS');
         $this->callback($this->onSuccess);
         $this->controller->redirectLocation($url, ___("Invoice processed"), ___("Invoice processed successfully"));
         // no return Am_Exception_Redirect
     } elseif ($this->result->isAction()) {
         $this->callback($this->onAction);
         $this->result->getAction()->process($this->controller);
         // no return Am_Exception_Redirect
     } else {
         //  ($result->isFailure()) {
         $this->callback($this->onFailure);
     }
     return $this->result;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:36,代码来源:PayProcessMediator.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Am_Di类代码示例发布时间:2022-05-23
下一篇:
PHP AlphaUserPointsHelper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap