Example #1
0
 private static function deliveryResponse()
 {
     $isAjax = Request::isAjax();
     if ($isAjax) {
         if (empty(self::$_reply) || !is_array(self::$_reply)) {
             exit('No reply seted by ajax controller or reply is not an array');
         }
         foreach (self::$_reply as $key => $value) {
             if ($key != 'reply' && !is_numeric($value) && !is_array($value) && $value) {
                 self::$_reply[$key] = Language::translation($value);
             }
         }
         Request::responseHeader();
         echo json_encode(self::$_reply);
     } else {
         Layout::MenuFooterAutoload();
         Layout::replaceTag();
         Layout::translation();
         Request::responseHeader();
         echo Layout::getLayout();
     }
 }