/**
  * (non-PHPdoc)
  * @see TControl::onInit()
  */
 public function onInit($param)
 {
     parent::onInit($param);
     $scriptArray = BPCPageAbstract::getLastestJS(get_class($this));
     foreach ($scriptArray as $key => $value) {
         if (($value = trim($value)) !== '') {
             if ($key === 'js') {
                 $this->getPage()->getClientScript()->registerScriptFile(__CLASS__ . 'Js', $this->publishAsset($value));
             } else {
                 if ($key === 'css') {
                     $this->getPage()->getClientScript()->registerStyleSheetFile(__CLASS__ . 'Css', $this->publishAsset($value));
                 }
             }
         }
     }
 }
Example #2
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (Core::getUser() instanceof UserAccount) {
         $this->getResponse()->redirect('/');
     }
     $cScripts = BPCPageAbstract::getLastestJS(get_class($this));
     if (isset($cScripts['js']) && ($lastestJs = trim($cScripts['js'])) !== '') {
         $this->getPage()->getClientScript()->registerScriptFile('pageJs', $this->publishAsset($lastestJs));
     }
     if (isset($cScripts['css']) && ($lastestCss = trim($cScripts['css'])) !== '') {
         $this->getPage()->getClientScript()->registerStyleSheetFile('pageCss', $this->publishAsset($lastestCss));
     }
     if (!$this->IsPostBack) {
         $this->username->focus();
         $this->errorDiv->visible = false;
     }
 }
Example #3
0
 /**
  * (non-PHPdoc)
  * @see TControl::onLoad()
  */
 public function onLoad($param)
 {
     $clientScript = $this->getPage()->getClientScript();
     if (!$this->getPage()->IsPostBack || !$this->getPage()->IsCallback) {
         $className = get_class($this);
         $scriptArray = BPCPageAbstract::getLastestJS($className);
         foreach ($scriptArray as $key => $value) {
             if (($value = trim($value)) !== '') {
                 if ($key === 'js') {
                     $this->getPage()->getClientScript()->registerScriptFile($className . 'JS', $this->publishAsset($value));
                 } else {
                     if ($key === 'css') {
                         $this->getPage()->getClientScript()->registerStyleSheetFile($className . 'CSS', $this->publishAsset($value));
                     }
                 }
             }
         }
     }
 }
Example #4
0
 /**
  * (non-PHPdoc)
  * @see TControl::onInit()
  */
 public function onInit($param)
 {
     parent::onInit($param);
     $scriptArray = BPCPageAbstract::getLastestJS(get_class($this));
     foreach ($scriptArray as $key => $value) {
         if (($value = trim($value)) !== '') {
             if ($key === 'js') {
                 $this->getPage()->getClientScript()->registerScriptFile('PaymentListPanelJs', $this->publishAsset($value));
             } else {
                 if ($key === 'css') {
                     $this->getPage()->getClientScript()->registerStyleSheetFile('PaymentListPanelCss', $this->publishAsset($value));
                 }
             }
         }
     }
     if (!$this->getPage()->IsCallBack && !$this->getPage()->IsPostBack) {
         $js = 'if(typeof(PaymentListPanelJs) !== "undefined") {';
         $js .= 'PaymentListPanelJs.callbackIds = ' . json_encode(array('getPayments' => $this->getPaymentsBtn->getUniqueID(), 'delPayment' => $this->delPaymentBtn->getUniqueID(), 'addPayment' => $this->addPaymentBtn->getUniqueID())) . ';';
         $js .= '}';
         $this->getPage()->getClientScript()->registerEndScript('plpJs', $js);
     }
 }