Пример #1
0
 public function setError($error)
 {
     if (Zmz_Utils::isDebug()) {
         if ($error instanceof Exception) {
             $errorString = $error->getMessage();
         }
     } else {
         if ($error instanceof Zmz_Error_Exception) {
             $errorString = $error->getMessage();
         }
     }
     if (empty($errorString)) {
         if (is_string($error)) {
             $errorString = $error;
         } else {
             $errorString = 'Application error';
         }
     }
     //        $errorString = (string) $error;
     //
     //
     //        if ($error instanceof Zmz_Json_Response_Exception) {
     //            $errorString = $error->getMessage();
     //        }
     //
     //
     //        if ($error instanceof Exception) {
     //            $errorString = $error->getMessage();
     //        } else {
     //            $errorString = (string) $error;
     //        }
     $this->_error = $errorString;
 }
Пример #2
0
 public function addJavascript($js)
 {
     $script = (string) $js;
     $script = Zmz_Utils::clearScript($script);
     $view = Zend_Layout::getMvcInstance()->getView();
     $view->headScript()->appendScript($script);
 }
Пример #3
0
 public function __construct(Zend_Form $form)
 {
     parent::__construct();
     $this->view = Zend_Layout::getMvcInstance()->getView();
     $this->formName = $form->getName();
     $elementsBelongTo = $form->getElementsBelongTo();
     $this->elementPrefix = '';
     if ($elementsBelongTo) {
         $this->elementPrefix = Zmz_Utils::stripFormArrayNotation($elementsBelongTo);
         $this->elementPrefix .= '-';
     }
     $this->init();
 }
Пример #4
0
 public function direct($default = null)
 {
     return Zmz_Utils::getReferer($default);
 }
Пример #5
0
 public function addJquery($js)
 {
     $script = (string) $js;
     $script = Zmz_Utils::clearScript($script);
     $this->jquery->addOnLoad($script);
 }