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


PHP UTIL_JsGenerator::newVariable方法代码示例

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


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

示例1: customizeControlCunfigure

 public function customizeControlCunfigure($customizeUrl, $normalUrl)
 {
     if ($this->allowCustomize) {
         $js = new UTIL_JsGenerator();
         $js->newVariable('dndCustomizeUrl', $customizeUrl);
         $js->newVariable('dndNormalUrl', $normalUrl);
         $js->jQueryEvent('#goto_customize_btn', 'click', 'if(dndCustomizeUrl) window.location.href=dndCustomizeUrl;');
         $js->jQueryEvent('#goto_normal_btn', 'click', 'if(dndNormalUrl) window.location.href=dndNormalUrl;');
         OW::getDocument()->addOnloadScript($js);
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:11,代码来源:drag_and_drop_entity_panel.php

示例2: crop

 /**
  * Action cropping avatar
  */
 public function crop()
 {
     $language = OW::getLanguage();
     $avatarService = BOL_AvatarService::getInstance();
     $userService = BOL_UserService::getInstance();
     $userId = OW_Auth::getInstance()->getUserId();
     $hasAvatar = $avatarService->userHasAvatar($userId);
     $this->assign('hasAvatar', $hasAvatar);
     if ($hasAvatar) {
         $this->assign('avatar', $avatarService->getAvatarUrl($userId, 2));
         $this->assign('original', $avatarService->getAvatarUrl($userId, 3));
     } else {
         $this->assign('default', $avatarService->getDefaultAvatarUrl(2));
     }
     $staticJsUrl = OW::getPluginManager()->getPlugin('base')->getStaticJsUrl();
     $staticCssUrl = OW::getPluginManager()->getPlugin('base')->getStaticCssUrl();
     OW::getDocument()->addScript($staticJsUrl . 'jquery.Jcrop.js');
     OW::getDocument()->addStyleSheet($staticCssUrl . 'jquery.Jcrop.css');
     OW::getDocument()->addScript($staticJsUrl . 'crop_avatar.js');
     $objParams = array('ajaxResponder' => $this->ajaxResponder, 'previewSize' => 100);
     $script = "\$(document).ready(function(){\n                var crop = new cropAvatar( " . json_encode($objParams) . ");\n                crop.initCrop();\n            }); ";
     OW::getDocument()->addOnloadScript($script);
     $profileEditUrl = OW::getRouter()->urlForRoute('base_edit');
     $js = new UTIL_JsGenerator();
     $js->newVariable('profileEditUrl', $profileEditUrl);
     $js->jQueryEvent('#button-profile-edit', 'click', 'window.location.href=profileEditUrl;');
     OW::getDocument()->addOnloadScript($js);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:31,代码来源:avatar.php


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