Ejemplo n.º 1
0
 public function register()
 {
     $validator = UserValidations::registration();
     $user = new modelUsers();
     $user->bind($_POST);
     if (!$user->check($validator)) {
         $error_hash = $validator->GetErrors();
         $errors = '';
         foreach ($error_hash as $inp_err) {
             $errors .= '' . $inp_err . ' |  ';
         }
         echo json_encode(array('error' => 'Ошибки: ' . $errors));
         return false;
     }
     if ($user->save($_POST)) {
         $password = joosRequest::post('password');
         $response = json_decode(modelUsers::login($user->user_name, $password, array('return' => 1)), true);
         if (isset($response['error'])) {
             echo json_encode(array('error' => $response['error']));
             return false;
         } else {
             echo json_encode(array('success' => 'всё пучком'));
             return true;
         }
     } else {
         //userHtml::register($user, $validator);
         echo json_encode(array('error' => 'Что-то не так с данными для регистрации'));
         return false;
     }
 }
Ejemplo n.º 2
0
    private function create()
    {
        if (headers_sent()) {
            !ob_get_level() ?: ob_end_clean();
        } else {
            joosRequest::send_headers('Content-type: text/html; charset=UTF-8');
        }
        $message = nl2br($this->getMessage());
        $result = <<<HTML
  <style>
    body { background-color: #fff; color: #333; }
    body, p, ol, ul, td { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 25px; }
    pre { background-color: #eee; padding: 10px; font-size: 11px; line-height: 18px; }
    a { color: #000; }
    a:visited { color: #666; }
    a:hover { color: #fff; background-color:#000; }
  </style>
<div style="width:99%; position:relative">
<h2 id='Title'>{$message}</h2>
<div id="Context" style="display: block;"><h3>Ошибка с кодом {$this->getCode()} в файле '{$this->getFile()}' в строке {$this->getLine()}:</h3><pre>{$this->prepare($this->get_file_context())}</pre></div>
<div id="Trace"><h2>Стэк вызовов</h2><pre>{$this->getTraceAsString()}</pre></div>
HTML;
        $result .= "</div></div>";
        return $result;
    }
Ejemplo n.º 3
0
 /**
  * Инициализация задачи
  *
  * @static
  * @param $code
  */
 private static function init($code)
 {
     joosRequest::send_headers_by_code($code);
     if (ob_get_level()) {
         ob_end_clean();
     }
 }
 /**
  * Генерация ссылки на страницу
  *
  * @return string|json string
  */
 public function slug_generator()
 {
     $title = joosRequest::post('title', '');
     // формируем из введённого заголовка страницы валидный UTL-адрес
     $slug = joosText::text_to_url($title);
     echo json_encode(array('slug' => $slug));
     return;
 }
Ejemplo n.º 5
0
 protected function before_store()
 {
     // выполняем сначала задачи родительского класа
     parent::before_store();
     // сохраняем группы пользователя
     $user_groops = joosRequest::array_param('user_groups');
     if ($user_groops !== null) {
         $this->save_one_to_many('#__users_acl_groups_users', 'user_id', 'group_id', $this->id, $user_groops);
     }
 }
Ejemplo n.º 6
0
 public function autocomplete()
 {
     $word = joosRequest::get('term');
     joosFilter::make_safe($word);
     // если пользователь ввёл меньше 2х символов - не будем выдавать ему подсказку
     if (strlen($word) > 2) {
         $result = modelSearch::get_log($word);
     } else {
         $result = false;
     }
     echo json_encode($result);
 }
Ejemplo n.º 7
0
 public function add_comment()
 {
     $obj_option = joosRequest::post('obj_option');
     $obj_id = joosRequest::int('obj_id', 0);
     $comment_text = joosRequest::post('comment_text');
     $parent_id = joosRequest::int('parent_id', 0);
     $comment = new modelComments();
     $comment->obj_option = $obj_option;
     $comment->obj_id = $obj_id;
     $comment->comment_text = $comment_text;
     $comment->parent_id = $parent_id;
     $comment->store();
     return array();
 }
 /**
  * Смена статуса доступа группы к действию
  *
  * @return array
  */
 public function change_rules()
 {
     $group_id = joosRequest::int('group_id');
     $task_id = joosRequest::int('task_id');
     $access = new modelUsersAclRolesGroups();
     $access->group_id = $group_id;
     $access->task_id = $task_id;
     $access->find();
     if ($access->id) {
         $access->delete($access->id);
     } else {
         $access->store();
     }
     return array('success' => true, 'message' => 'Сохранено');
 }
Ejemplo n.º 9
0
 /**
  * Получение уникального ключа для значения пользовательской сессии
  *
  * @static
  * @param  null   $hash_key
  * @return string
  *
  * @todo добавить возможность работы через прокси, когда у пользователя меняется конечный IP, но единый IP прокси
  */
 public static function session_cookie_value($hash_key = null)
 {
     $user_ip = joosRequest::user_ip();
     $user_browser = joosRequest::server('HTTP_USER_AGENT', 'none');
     $type = joosConfig::get2('session', 'type', 2);
     switch ($type) {
         case 1:
             $value = md5($hash_key . $user_ip);
             break;
         default:
             $value = joosCSRF::hash($hash_key . $user_ip . $user_browser);
             break;
     }
     return $value;
 }
Ejemplo n.º 10
0
 /**
  * Главная страница компонента, вывод списка объектов
  *
  * @static
  * @return array
  */
 public function index()
 {
     $search_result = array();
     $total = 0;
     $search_word = isset(self::$param['search_word']) ? self::$param['search_word'] : '';
     if (isset($_POST['search'])) {
         $search_word = joosRequest::post('search');
         $search_word = joosText::simple_clean($search_word);
         $search_word = joosFilter::htmlspecialchars($search_word);
         joosRoute::redirect(joosRoute::href('search_word', array('search_word' => $search_word)));
     }
     $search_word = joosText::simple_clean($search_word);
     joosFilter::make_safe($search_word);
     if (strlen($search_word) > 100) {
         $search_word = joosString::substr($search_word, 0, 99);
     }
     if ($search_word && joosString::strlen($search_word) < 3) {
         $search_word = '';
     }
     if ($search_word != '') {
         $results = joosDatabase::instance()->set_query("SELECT t.id, t.title,t.`fulltext` as text, t.type_id, t.type_cat_id, t.created_at, t.anons_image_id, t.file_id,'topic' AS itemtype,\n                g.title AS gamename, t.game_id, g.slug AS game_slug\n                FROM #__texts as t\n                LEFT JOIN #__games AS g ON g.id=t.game_id\n                WHERE LOWER(t.title) LIKE LOWER('%{$search_word}%') OR  LOWER(t.`fulltext`) LIKE LOWER('%{$search_word}%') ")->load_object_list();
         $rows = array();
         $_n = count($results);
         for ($i = 0, $n = $_n; $i < $n; $i++) {
             $rows = array_merge((array) $rows, (array) $results[$i]);
         }
         $total = count($rows);
         for ($i = 0; $i < $total; $i++) {
             $text =& $rows[$i]->text;
             $search_words = explode(' ', $search_word);
             $needle = $search_words[0];
             $text = modelSearch::prepare_search_content($text, 500, $needle);
             foreach ($search_words as $k => $hlword) {
                 $search_words[$k] = htmlspecialchars(stripslashes($hlword), ENT_QUOTES, 'UTF-8');
             }
             $searchRegex = implode('|', $search_words);
             $text = preg_replace('/' . $searchRegex . '/iu', '<span class="highlight">\\0</span>', $text);
         }
         $search_result = $rows;
     }
     $page = self::$param['page'];
     $pager = new joosPager(joosRoute::href('search_word', array('search_word' => $search_word)), $total, 10);
     $pager->paginate($page);
     // для первой (0) страницы и если есть результаты поиска - запишем словопоиск в базу, для дальнейших ленивых автокомплитов
     $total > 0 && $page == 0 ? modelSearch::add($search_word) : null;
     return array('search_word' => $search_word, 'search_result' => $search_result, 'pager' => $pager);
 }
Ejemplo n.º 11
0
 /**
  * Получение системного сообщения
  * @return string - текст сообщения
  */
 public static function get()
 {
     $_s = session_id();
     if (!joosCore::is_admin() && empty($_s)) {
         session_name(joosSession::session_cookie_name());
         session_start();
     }
     $message = joosRequest::session('joostina.mosmsg', false);
     if ($message != '' && joosString::strlen($message) > 300) {
         // выводим сообщения не длинее 300 символов
         $message = joosString::substr($message, 0, 300);
     }
     /**
             @var $_SESSION array */
     unset($_SESSION['joostina.mosmsg']);
     return $message ? '<div class="b-system_message">' . $message . '</div>' : '';
 }
 public function upload()
 {
     // активное правило загрузки для файла
     $rules_name = joosRequest::post('rules_name');
     joosUpload::init($rules_name);
     $upload_result = array();
     $check = joosUpload::check();
     if ($check === true) {
         $upload_result = joosUpload::actions_before() + $upload_result;
         $upload_result = joosUpload::easy_upload(joosUpload::get_input_name(), joosUpload::get_upload_location()) + $upload_result;
         $upload_result = joosUpload::actions_after($upload_result) + $upload_result;
         // удаляем физически файл если проверки не прошли в пользователю выдаём ошибку
         if ($upload_result['success'] !== true) {
             joosFile::delete($upload_result['file_base_location']);
         }
     } else {
         $upload_result = $check;
     }
     // подчищаем секретные данные
     unset($upload_result['file_base_location']);
     return $upload_result;
 }
Ejemplo n.º 13
0
 public static function check_code($alt = null, $method = 'post')
 {
     switch (strtolower($method)) {
         case 'get':
             $validate = joosRequest::get(self::get_code($alt), 0);
             break;
         case 'request':
             $validate = joosRequest::request(self::get_code($alt), 0);
             break;
         case 'post':
         default:
             $validate = joosRequest::post(self::get_code($alt), 0);
             break;
     }
     if (!$validate) {
         joosPages::page403();
     }
     if (!isset($_SERVER['HTTP_USER_AGENT'])) {
         joosPages::page403();
     }
     if (!$_SERVER['REQUEST_METHOD'] == 'POST') {
         joosPages::page403();
     }
 }
Ejemplo n.º 14
0
 * Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл help/copyright.php.
 */
// Установка флага родительского файла
define('_JOOS_CORE', 1);
// корень файлов панели управления
define('JPATH_BASE_ADMIN', __DIR__);
require_once dirname(JPATH_BASE_ADMIN) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'joostina.php';
require_once JPATH_BASE . DS . 'app' . DS . 'bootstrap.php';
require_once JPATH_BASE . DS . 'core' . DS . 'admin.root.php';
joosDocument::header();
// работа с сессиями начинается до создания главного объекта взаимодействия с ядром
joosCoreAdmin::start();
// стартуем пользователя
joosCoreAdmin::init_user();
if (helperAcl::is_allowed('admin_panel::use')) {
    echo json_encode(array('code' => 500, 'message' => 'Ошибка прав доступа'));
    die;
}
$option = joosRequest::param('option');
ob_start();
// файл обработки Ajax запросов конкретного компонента
$file_com = JPATH_BASE . DS . 'app' . DS . 'components' . DS . $option . DS . 'controller.admin.' . $option . '.ajax.php';
// проверяем, какой файл необходимо подключить, данные берутся из пришедшего GET запроса
if (file_exists($file_com)) {
    include_once $file_com;
    joosAutoadmin::dispatch_ajax();
} else {
    echo json_encode(array('code' => 500, 'message' => sprintf('Файл контроллера для %s не найден', $file_com)));
    die;
}
ob_end_flush();
Ejemplo n.º 15
0
 public static function get_scheme($item)
 {
     $group = isset($item->params_group) ? $item->params_group : joosRequest::request('option');
     $file = 'app' . DS . 'components' . DS . $group . DS . 'params.' . $group . '.php';
     $file = JPATH_BASE . DS . $file;
     $model = 'params' . ucfirst($group);
     if (joosFile::exists($file)) {
         require_once $file;
         $params = array('notdefault' => array('name' => 'Использовать уникальные параметры', 'editable' => true, 'html_edit_element' => 'checkbox', 'html_edit_element_param' => array('text' => 'Использовать уникальные параметры')));
         $add_params = $model::get_params_scheme($item->params['subgroup']);
         if ($add_params) {
             $params += $model::get_params_scheme($item->params['subgroup']);
             return $params;
         }
         return false;
     } else {
         return false;
     }
 }
Ejemplo n.º 16
0
 /**
  * Разлогинивание епользователя
  */
 public function logout()
 {
     joosCSRF::check_code(1);
     modelUsers::logout();
     $return = joosRequest::param('return');
     if ($return && !(strpos($return, 'registration') || strpos($return, 'login'))) {
         joosRoute::redirect($return);
     } elseif (isset($_SERVER['HTTP_REFERER'])) {
         joosRoute::redirect($_SERVER['HTTP_REFERER']);
     } else {
         joosRoute::redirect(JPATH_SITE);
     }
 }
Ejemplo n.º 17
0
 public function before_store()
 {
     // формирование ссылки на категорию блогов
     $new_slug = joosRequest::param('slug', false);
     $this->slug = $new_slug ? $new_slug : joosText::text_to_url($this->title);
     return true;
 }
Ejemplo n.º 18
0
 /**
  * Идентификация браузера
  *
  */
 private function get_related_string()
 {
     return sprintf('%s-%s-%s-%s', JPATH_COOKIE, joosRequest::server('HTTP_ACCEPT_ENCODING'), joosRequest::server('HTTP_USER_AGENT'), joosRequest::server('HTTP_ACCEPT_LANGUAGE'));
 }
Ejemplo n.º 19
0
 public static function autoajax()
 {
     //$option = joosRequest::param('option');
     // выполняемая задача
     $task = joosRequest::param('task');
     // идентификатор запрашиваемого элемента
     $obj_id = joosRequest::int('obj_id', 0, $_POST);
     // ключ-название запрашиваемого элемента
     $obj_key = joosRequest::post('obj_key');
     // название объекта запрашиваемого элемента
     $model = joosRequest::param('obj_model');
     if (!$model) {
         return false;
     }
     // пустой объект для складирования результата
     $return_onj = new stdClass();
     if (class_exists($model)) {
         // создаём объект класса
         $obj = new $model();
         switch ($task) {
             case 'status_change':
                 $obj->load($obj_id);
                 // меняем состояние объекта на противоположное
                 $obj->change_state($obj_key);
                 // получаем настройки полей
                 $fields_info = $obj->get_fieldinfo();
                 $fields_info[$obj_key] = array_merge_recursive($fields_info[$obj_key], array('html_table_element_param' => array('statuses' => array(0 => 'Скрыто', 1 => 'Опубликовано'), 'images' => array(0 => 'publish_x.png', 1 => 'publish_g.png'))));
                 // формируем ответ из противоположных элементов текущему состоянию
                 $return_onj->image = isset($fields_info[$obj_key]['html_table_element_param']['images'][!$obj->{$obj_key}]) ? $fields_info[$obj_key]['html_table_element_param']['images'][!$obj->{$obj_key}] : 'error.png';
                 $return_onj->mess = isset($fields_info[$obj_key]['html_table_element_param']['statuses'][!$obj->{$obj_key}]) ? $fields_info[$obj_key]['html_table_element_param']['statuses'][!$obj->{$obj_key}] : 'ERROR';
                 $return_onj->new_class = $obj->{$obj_key} ? 'icon-remove' : 'icon-ok';
                 break;
             default:
                 return false;
                 break;
         }
         echo json_encode($return_onj);
         return true;
     }
     $return_onj->image = 'error.png';
     $return_onj->mess = 'error-class';
     echo json_encode($return_onj);
     return false;
 }
 public function codegenerator()
 {
     $template_vars_default = array('component_title' => '', 'component_name' => '', 'component_description' => '', 'component_author' => 'Joostina Team', 'component_authoremail' => '*****@*****.**', 'component_copyright' => '(C) 2007-2012 Joostina Team');
     $template_vars = array();
     foreach ($template_vars_default as $var => $default_value) {
         $value = joosRequest::post($var, false);
         $template_vars[':' . $var] = $value ? $value : $default_value;
     }
     $template_vars[':component_name_camelcase'] = joosInflector::camelize($template_vars[':component_name']);
     $template_path_root = JPATH_BASE . DS . 'app' . DS . 'components' . DS . 'coder' . DS . 'templates' . DS . 'component' . DS;
     $template_files = array('controller.component_name', 'controller.component_name.ajax', 'controller.admin.component_name', 'controller.admin.component_name.ajax');
     $return = array();
     $create_files = array();
     foreach ($template_files as $template_file) {
         $template_body = joosFile::get_content($template_path_root . $template_file);
         $file_body = strtr($template_body, $template_vars);
         $file_name = str_replace('component_name', $template_vars[':component_name'], $template_file);
         $return[$template_file] = sprintf('%s.php<br /><textarea class="span10" rows="10">%s</textarea>', $file_name, $file_body);
         $create_files[$file_name] = $file_body;
     }
     return array('success' => true, 'body' => implode("\n", $return), 'component_name' => $template_vars[':component_name'], 'files_body' => $create_files);
 }
Ejemplo n.º 21
0
 /**
  * Смена статуса (поля 'state')
  */
 public static function set_state()
 {
     $obj_id = joosRequest::int('obj_id', 0, $_POST);
     $obj_state = joosRequest::post('obj_state');
     $obj_model = joosRequest::post('obj_model');
     if (!$obj_model || !class_exists($obj_model)) {
         return array('type' => 'error');
     }
     $new_state = $obj_state == 1 ? 0 : 1;
     $obj = new $obj_model();
     $obj->load($obj_id);
     if (!$obj->change_state('state')) {
         return array('type' => 'error');
     }
     return array('type' => 'success', 'message' => 'Статус изменён', 'new_state' => $new_state, 'new_title' => $new_state == 1 ? 'Активно' : 'Не активно', 'new_class' => $new_state == 1 ? 'icon-ok' : 'icon-remove');
 }
Ejemplo n.º 22
0
 /**
  * Системный 301 редирект
  *
  * @param  string $url  ссылка, на которую надо перейти
  * @param  string $msg  текст сообщения, отображаемый после перехода
  * @param  string $type тип перехода - ошибка, предупреждение, сообщение и т.д.
  * @return void
  */
 public function redirect($url, $msg = '', $type = 'success')
 {
     $iFilter = joosInputFilter::instance();
     $url = $iFilter->process($url);
     empty($msg) ? null : joosFlashMessage::add($iFilter->process($msg), $type);
     $url = preg_split("/[\r\n]/", $url);
     $url = $url[0];
     if ($iFilter->badAttributeValue(array('href', $url))) {
         $url = JPATH_SITE;
     }
     if (headers_sent()) {
         echo "<script>document.location.href='{$url}';</script>\n";
     } else {
         !ob_get_level() ?: ob_end_clean();
         joosRequest::send_headers_by_code(301);
         joosRequest::send_headers("Location: " . $url);
     }
     exit;
 }
Ejemplo n.º 23
0
 /**
  * Вывод сгенерированного изображения
  * Данный метод вызывает метод render() и выводит сгенерированное изображение в браузер или файл
  *
  * @param  mixed   $input   Имя файла, изображение-строка или GD-resource
  * @param  mixed   $output  Имя файла-результата. Если null - будет выведено в браузер
  * @param  array   $options Массив настроек
  *          <pre>
  *          width   int    Ширина изображения-результата
  *          height  int    Высота изображения-результата
  *          percent number Размер изображения-результата в процентах от исходного
  *          method  int    Метод ресайза
  *          halign  int    Горизонтальное выравнивание
  *          valign  int    Вертикальное выравнивание
  *          check_size int Производить проверку размеров (в этом случае изображение не ресайзится, если необходимый размер больше исходного)
  *          quality int    Качество выдаваемого изображения. 0-100
  *          x int        Растояние в пикселях от левого края, для обрезания
  *          y int        Растояние в пикселях от верхнего края, для обрезания
  *         </pre>
  *
  * @return boolean          TRUE on success or FALSE on failure.
  * @access public
  */
 public static function output($input, $output = null, $options = array())
 {
     // Load source file and render image
     $renderImage = Thumbnail::render($input, $options);
     if (!$renderImage) {
         throw new joosImageLibrariesException('Error rendering image');
     }
     // Set output image type
     // By default PNG image
     $type = isset($options['type']) ? $options['type'] : IMAGETYPE_JPEG;
     $quality = isset($options['quality']) ? $options['quality'] : ($type == IMAGETYPE_PNG ? 8 : 80);
     $quality = $type == IMAGETYPE_PNG ? (int) $quality / 10 : $quality;
     // что бы не указывать в параметрах 0-100 для JPG и 0-9 для PNG - можно всегда 0-100, а тут подправим
     // Before output to browsers send appropriate headers
     if (empty($output)) {
         $content_type = image_type_to_mime_type($type);
         if (!headers_sent()) {
             joosRequest::send_headers('Content-Type: ' . $content_type);
         } else {
             throw new joosImageLibrariesException('Headers have already been sent. Could not display image.');
         }
     } else {
         $content_type = 'ERROR';
     }
     switch ($type) {
         case IMAGETYPE_GIF:
             $result = empty($output) ? imagegif($renderImage) : imagegif($renderImage, $output);
             break;
         case IMAGETYPE_PNG:
             $result = empty($output) ? imagepng($renderImage) : imagepng($renderImage, $output, $quality);
             break;
         case IMAGETYPE_JPEG:
             $result = empty($output) ? imagejpeg($renderImage) : imagejpeg($renderImage, $output, $quality);
             break;
         default:
             throw new joosImageLibrariesException('Image type ' . $content_type . ' not supported by PHP');
     }
     if (!$result) {
         throw new joosImageLibrariesException('Error output image', E_USER_NOTICE);
     }
     // освобождаем память, выделенную для изображения
     imagedestroy($renderImage);
     return true;
 }
Ejemplo n.º 24
0
 public static function header()
 {
     if (!headers_sent()) {
         if (self::$cache_header_time) {
             header_remove('Pragma');
             joosRequest::send_headers('Cache-Control: max-age=' . self::$cache_header_time);
             joosRequest::send_headers('Expires: ' . gmdate('r', time() + self::$cache_header_time));
         } else {
             joosRequest::send_headers('Pragma: no-cache');
             joosRequest::send_headers('Cache-Control: no-cache, must-revalidate');
         }
         joosRequest::send_headers('X-Powered-By: Joostina CMS');
         joosRequest::send_headers('Content-type: text/html; charset=UTF-8');
     }
 }
Ejemplo n.º 25
0
 public function before_store()
 {
     $comment_text = $this->comment_text;
     $comment_text = joosText::text_clean($comment_text);
     $comment_text = joosText::word_limiter($comment_text, 200);
     $this->comment_text = $comment_text;
     $this->user_id = joosCore::user()->id;
     $this->user_ip = joosRequest::user_ip();
     // высчитываем родителя и заполняем дерево
     if ($this->parent_id > 0) {
         $parent = new modelComments();
         $parent->load($this->parent_id);
         $this->level = $parent->level + 1;
         $this->path = $parent->path . ',' . $parent->id;
     } else {
         $this->path = 0;
     }
     $this->state = 1;
     return true;
 }
Ejemplo n.º 26
0
<?php

joosRequest::send_headers('modelContent-Type: text/html; charset=utf-8');
joosRequest::send_headers('Cache-Control: s-maxage=0, max-age=0, must-revalidate');
joosRequest::send_headers('Expires: Mon, 23 Jan 1978 10:00:00 GMT');
function __install($s)
{
    return $s;
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="robots" content="noindex">
    <title><?php 
echo __install('Установка Joostina CMS');
?>
</title>
    <style type="text/css">
        html {
            font: 13px/1.5 Verdana, sans-serif;
            border-top: 5.3em solid #F4EBDB;
        }

        body {
            border-top: 1px solid #E4DED5;
            margin: 0;
            background: white;
            color: #333;
        }
Ejemplo n.º 27
0
    /**
     * Вывод информации о переменной
     *
     * @tutorial joosDebug::dump( array(1, 'aad', time() ), $var_name );
     * @tutorial joosDebug::dump( $var_name_1,  $var_name_2,  $var_name_3,  $var_name_4 );
     *
     * @param mixed функция принимает неограниченное число параметров - переменных для анализа и вывода
     *
     * @todo расширить для использования в ajax-запросах
     */
    public static function dump()
    {
        joosRequest::send_headers_by_code(503);
        // обозначение места вызова функции отладки
        $trace = debug_backtrace();
        if (isset($trace[1]['file'])) {
            $file_content = self::get_file_context($trace[1]['file'], $trace[1]['line']);
        } else {
            $file_content = self::get_file_context($trace[0]['file'], $trace[0]['line']);
        }
        if (ob_get_level()) {
            ob_end_clean();
        }
        ob_start();
        $func_args = func_get_args();
        $args_count = count($func_args);
        var_dump($args_count == 1 ? $func_args[0] : $func_args);
        $output = ob_get_clean();
        $output = preg_replace('/]\\=>\\n(\\s+)/m', '] => ', $output);
        /**
         * @todo тут надо провреить, переменная судя по всему не используется в полном объёме
         */
        $result = joosFilter::htmlspecialchars($output);
        $file_content = joosFilter::htmlspecialchars($file_content);
        $result = <<<HTML
  <style>
    body { background-color: #fff; color: #333; }
    body, p, ol, ul, td { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 25px; }
    pre { background-color: #eee; padding: 10px; font-size: 11px; line-height: 18px; }
    a { color: #000; }
    a:visited { color: #666; }
    a:hover { color: #fff; background-color:#000; }
  </style>
<div style="width:99%; position:relative">
<h2 id='Title'>Результат отладки</h2>
<div id="Context" style="display: block;">Место вызова:<pre>{$file_content}</pre></div>
<div id="Context" style="display: block;">Полученные параметры:<pre>{$result}</pre></div>
HTML;
        $result .= "</div>";
        echo $result;
        die;
    }
Ejemplo n.º 28
0
 public static function ajax_error404()
 {
     joosRequest::send_headers_by_code(404);
     return array('error' => 404);
 }
Ejemplo n.º 29
0
    <?php 
joosModuleAdmin::load_by_name('flash_message');
?>

    <div id="component"><?php 
echo joosDocument::get_body();
?>
</div>

</div>
    <script type="text/javascript">
        var _live_site = '<?php 
echo JPATH_SITE;
?>
';
        var _option = '<?php 
echo joosRequest::param('option');
?>
';
        var _cur_template = '<?php 
echo JTEMPLATE_ADMIN;
?>
';
    </script>
    <?php 
echo joosDocument::footer_data();
?>
</body>
</html>
Ejemplo n.º 30
0
 public function add_to_basket()
 {
     $obj_name = joosRequest::post('obj');
     $obj_id = joosRequest::post('obj_id');
     return joosBasket::add($obj_name, $obj_id);
 }