예제 #1
0
 function loadCustomCssJs()
 {
     parent::loadCustomCssJs();
     $attrs = $this->modx->user->getAttributes(array(), '', true);
     $policies = array();
     if (!empty($attrs['modAccessContext']['mgr'])) {
         foreach ($attrs['modAccessContext']['mgr'] as $attr) {
             foreach ($attr['policy'] as $policy => $value) {
                 if (empty($policies[$policy])) {
                     $policies[$policy] = $value;
                 }
             }
         }
     }
     $this->modx->regClientStartupScript('<script type="text/javascript">
         Shop.policies = ' . $this->modx->toJSON($policies) . ';
     </script>', true);
     /*$this->addJavascript($this->getOption('assets_url').'js/shop.js'); 
       
       
       
       $this->addHtml('<script type="text/javascript">
           Shop.config = '. $this->modx->toJSON($this->config).';
       </script>');*/
     return;
 }
예제 #2
0
 function loadCustomCssJs()
 {
     parent::loadCustomCssJs();
     # $this->addJavascript($this->getOption('assets_url').'js/samplepackage.js');
     $this->addHtml('<script type="text/javascript">
   ' . $this->module_name . '.config = ' . $this->modx->toJSON($this->config) . ';
 </script>');
     return;
 }
예제 #3
0
 function loadCustomCssJs()
 {
     parent::loadCustomCssJs();
     $this->addJavascript($this->getOption('assets_url') . 'js/modxsdk.js');
     $this->addHtml('<script type="text/javascript">
         modxSDK.config = ' . $this->modx->toJSON($this->config) . ';
     </script>');
     return;
 }
예제 #4
0
 function loadCustomCssJs()
 {
     parent::loadCustomCssJs();
     $mgrUrl = $this->modx->getOption('manager_url', null, MODX_MANAGER_URL);
     $this->modx->regClientStartupScript($mgrUrl . 'assets/modext/widgets/element/modx.panel.tv.renders.js');
     $assets_url = $this->getOption('assets');
     $this->addJavascript($assets_url . 'js/core/shopmodxgroupedit.js');
     $this->addHtml('<script type="text/javascript">
         shopModxGroupEdit.config = ' . $this->modx->toJSON($this->config) . ';
     </script>');
     return;
 }
예제 #5
0
 function loadCustomCssJs()
 {
     parent::loadCustomCssJs();
     $assets_url = $this->getOption('assets_url');
     $this->modx->regClientStartupScript($assets_url . "js/modHybridAuth.js");
     $this->modx->regClientStartupScript($assets_url . "js/widgets/panel.js");
     $attrs = $this->modx->user->getAttributes(array(), '', true);
     $policies = array();
     if (!empty($attrs['modAccessContext']['mgr'])) {
         foreach ($attrs['modAccessContext']['mgr'] as $attr) {
             foreach ($attr['policy'] as $policy => $value) {
                 if (empty($policies[$policy])) {
                     $policies[$policy] = $value;
                 }
             }
         }
     }
     $this->modx->regClientStartupScript('<script type="text/javascript">
         modHybridAuth.policies = ' . $this->modx->toJSON($policies) . ';
     </script>', true);
     return;
 }