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


PHP UTIL_HtmlTag::escapeJs方法代码示例

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


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

示例1: checkItemLicense

 /**
  * Generic action to get the license key for items.
  */
 public function checkItemLicense()
 {
     $params = $_GET;
     $language = OW::getLanguage();
     $params[BOL_StorageService::URI_VAR_LICENSE_CHECK_COMPLETE] = 0;
     $params[BOL_StorageService::URI_VAR_LICENSE_CHECK_RESULT] = 0;
     if (empty($params[BOL_StorageService::URI_VAR_KEY]) || empty($params[BOL_StorageService::URI_VAR_ITEM_TYPE]) || empty($params[BOL_StorageService::URI_VAR_DEV_KEY])) {
         $errMsg = $language->text("admin", "check_license_invalid_params_err_msg");
         OW::getFeedback()->error($errMsg);
         $this->redirectToBackUri($params);
         $this->assign("message", $errMsg);
         return;
     }
     $key = trim($params[BOL_StorageService::URI_VAR_KEY]);
     $devKey = trim($params[BOL_StorageService::URI_VAR_DEV_KEY]);
     $type = trim($params[BOL_StorageService::URI_VAR_ITEM_TYPE]);
     $data = $this->storageService->getItemInfoForUpdate($key, $devKey);
     if (!$data) {
         $this->assign("backButton", true);
         $errMsg = $language->text("admin", "check_license_invalid_server_responce_err_msg");
         OW::getFeedback()->error($errMsg);
         $this->redirectToBackUri($params);
         $this->assign("message", $errMsg);
         return;
     }
     // if item is freeware reset check ts and redirect to back uri
     if ((bool) $data[BOL_StorageService::URI_VAR_FREEWARE]) {
         $params[BOL_StorageService::URI_VAR_LICENSE_CHECK_COMPLETE] = 1;
         $params[BOL_StorageService::URI_VAR_LICENSE_CHECK_RESULT] = 1;
         $params[BOL_StorageService::URI_VAR_FREEWARE] = 1;
         $this->assign("message", $language->text("admin", "check_license_item_is_free_msg"));
         $dto = $this->storageService->findStoreItem($key, $devKey, $params[BOL_StorageService::URI_VAR_ITEM_TYPE]);
         if ($dto != null) {
             $dto->setLicenseCheckTimestamp(null);
             $this->storageService->saveStoreItem($dto);
         }
         $this->redirectToBackUri($params);
         return;
     }
     $this->assign("text", $language->text("admin", "license_request_text", array("type" => $type, "title" => $data["title"])));
     $form = new Form("license-key");
     $licenseKey = new TextField("key");
     $licenseKey->setRequired();
     $licenseKey->setLabel($language->text("admin", "com_plugin_request_key_label"));
     $form->addElement($licenseKey);
     $submit = new Submit("submit");
     $submit->setValue($language->text("admin", "license_form_button_label"));
     $form->addElement($submit);
     if (isset($params["back-button-uri"])) {
         $button = new Button("button");
         $button->setValue($language->text("admin", "license_form_back_label"));
         $redirectUrl = UTIL_HtmlTag::escapeJs(OW_URL_HOME . urldecode($params["back-button-uri"]));
         $button->addAttribute("onclick", "window.location='{$redirectUrl}'");
         $form->addElement($button);
         $this->assign("backButton", true);
     }
     $this->addForm($form);
     if (OW::getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $data = $form->getValues();
             $licenseKey = $data["key"];
             $result = $this->storageService->checkLicenseKey($key, $devKey, $licenseKey);
             $params[BOL_StorageService::URI_VAR_LICENSE_CHECK_COMPLETE] = 1;
             if ($result) {
                 $params[BOL_StorageService::URI_VAR_LICENSE_CHECK_RESULT] = 1;
                 $params[BOL_StorageService::URI_VAR_LICENSE_KEY] = urlencode($licenseKey);
                 $dto = $this->storageService->findStoreItem($key, $devKey, $params[BOL_StorageService::URI_VAR_ITEM_TYPE]);
                 if ($dto != null) {
                     $dto->setLicenseKey($licenseKey);
                     $dto->setLicenseCheckTimestamp(null);
                     $this->storageService->saveStoreItem($dto);
                 }
                 OW::getFeedback()->info($language->text("admin", "plugins_manage_license_key_check_success"));
                 $this->redirectToBackUri($params);
                 $this->redirect();
             } else {
                 OW::getFeedback()->error($language->text('admin', 'plugins_manage_invalid_license_key_error_message'));
                 $this->redirect();
             }
         }
     }
 }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:85,代码来源:storage.php


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