Example #1
0
<?php

/*
 * mobiCMS Content Management System (http://mobicms.net)
 *
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 */
defined('MOBICMS') or die('Error: restricted access');
use Config\System as Config;
$uri = App::request()->getUri();
$form = new Mobicms\Form\Form(['action' => $uri]);
$form->title(_dg('Clear Cache'))->html('<span class="description">' . _dg('The Cache clearing is required after installing a new language or upgrade existing ones.') . '</span>')->element('submit', 'update', ['value' => _dg('Clear Cache'), 'class' => 'btn btn-primary btn-xs'])->title(_dg('Default Language'))->element('radio', 'lng', ['checked' => Config::$lng, 'description' => _dg('If the choice is prohibited, the language will be forced to set for all visitors. If the choice is allowed, it will be applied only in the case, if requested by the client language is not in the system.'), 'items' => App::lng()->getLocalesList()])->element('checkbox', 'lngSwitch', ['checked' => Config::$lngSwitch, 'label_inline' => _dg('Allow to choose'), 'description' => _dg('Allow visitors specify the desired language from the list of available in the system. Including activated auto select languages by signatures of the browser.')])->divider()->element('submit', 'submit', ['value' => _g('Save'), 'class' => 'btn btn-primary'])->html('<a class="btn btn-link" href="../">' . _g('Back') . '</a>');
if ($form->process() === true) {
    if (isset($form->input['update'])) {
        // Обновляем кэш
        App::lng()->clearCache();
        App::redirect($uri . '?cache');
    } else {
        // Записываем настройки
        App::session()->remove('lng');
        (new Mobicms\Config\WriteHandler())->write('System', $form->output);
        App::redirect($uri . '?saved');
    }
}
App::view()->form = $form->display();
App::view()->setTemplate('edit_form.php');
Example #2
0
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 *
 * @module      System Tools
 * @author      Oleg (AlkatraZ) Kasyanov <*****@*****.**>
 * @version     v.1.0.0 2015-02-01
 */
@ini_set("max_execution_time", "600");
defined('MOBICMS') or die('Error: restricted access');
$user = App::user()->get();
if ($user->rights >= 7) {
    $sv_actions = ['counters' => 'counters.php', 'firewall' => 'firewall.php', 'languages' => 'languages.php', 'sitemap' => 'sitemap.php', 'system_settings' => 'system_settings.php'];
    $admin_actions = ['acl' => 'acl.php', 'links' => 'links.php', 'users_settings/quarantine' => 'quarantine.php', 'scanner' => 'scanner.php', 'smilies' => 'smilies.php', 'users_settings' => 'users_settings.php'];
    $common_actions = [];
    App::lng()->setModule('admin');
    $query = implode('/', App::router()->getQuery());
    $include = __DIR__ . '/includes/';
    if (!empty($query)) {
        if ($user->rights == 9 && isset($sv_actions[$query])) {
            $include .= $sv_actions[$query];
        } elseif ($user->rights >= 7 && isset($admin_actions[$query])) {
            $include .= $admin_actions[$query];
        } elseif (isset($common_actions[$query])) {
            $include .= $common_actions[$query];
        } else {
            $include = false;
        }
    } else {
        $include .= 'index.php';
    }
Example #3
0
<?php

/*
 * mobiCMS Content Management System (http://mobicms.net)
 *
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 */
defined('MOBICMS') or die('Error: restricted access');
$uri = App::request()->getUri();
$config = App::profile()->config();
$items['#'] = _dg('Select automatically');
$items = array_merge($items, App::lng()->getLocalesList());
$form = new Mobicms\Form\Form(['action' => $uri]);
$form->title(_dg('Select Language'))->element('radio', 'lng', ['checked' => $config->lng, 'items' => $items, 'description' => _dg('If you turn on automatic mode, the system language is set depending on the settings of your browser.')])->divider()->element('submit', 'submit', ['value' => _g('Save'), 'class' => 'btn btn-primary'])->html('<a class="btn btn-link" href="../">' . _g('Back') . '</a>');
if ($form->process() === true) {
    $config->lng = $form->output['lng'];
    $config->save();
    App::session()->remove('lng');
    App::redirect($uri . '?saved');
}
App::view()->form = $form->display();
App::view()->setTemplate('edit_form.php');
Example #4
0
 *
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 *
 * @module      User Profile
 * @author      Oleg (AlkatraZ) Kasyanov <*****@*****.**>
 * @version     v.1.0.0 2015-02-01
 */
defined('MOBICMS') or die('Error: restricted access');
$public_actions = ['reputation' => 'reputation.php'];
$personal_actions = ['option' => 'option.php', 'option/avatar' => 'option_avatar.php', 'option/avatar/animation' => 'option_avatar_animation.php', 'option/avatar/delete' => 'option_avatar_delete.php', 'option/avatar/gravatar' => 'option_avatar_gravatar.php', 'option/avatar/image' => 'option_avatar_image.php', 'option/edit' => 'option_edit.php', 'option/email' => 'option_email.php', 'option/language' => 'option_language.php', 'option/nickname' => 'option_nickname.php', 'option/password' => 'option_password.php', 'option/rank' => 'option_rank.php', 'option/settings' => 'option_settings.php', 'option/theme' => 'option_theme.php'];
App::lng()->setModule('profile');
$query = App::router()->getQuery();
$user = App::user()->get();
$include = __DIR__ . '/includes/';
if (isset($query[0])) {
    try {
        if (!ctype_digit($query[0]) || $query[0] < 1) {
            throw new Exception('Invalid data');
        }
        $profile = App::user()->findById($query[0]);
        App::registerInstance($profile, 'profile');
        if (isset($query[1])) {
            $act = implode('/', array_slice($query, 1));
            if (($user->rights == 9 || $user->rights == 7 && $user->rights > $profile->rights || App::user()->isValid() && $user->id == $profile->id) && isset($personal_actions[$act])) {
                $include .= $personal_actions[$act];
            } elseif (isset($public_actions[$act])) {
Example #5
0
/*
 * mobiCMS Content Management System (http://mobicms.net)
 *
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 *
 * @module      Help System
 * @author      Oleg (AlkatraZ) Kasyanov <*****@*****.**>
 * @version     v.1.0.0 2015-02-01
 */
defined('MOBICMS') or die('Error: restricted access');
$query = App::router()->getQuery();
App::lng()->setModule('help');
if (isset($query[0])) {
    switch ($query[0]) {
        case 'avatars':
            require_once __DIR__ . '/includes/avatars.php';
            break;
        case 'rules':
            App::view()->setTemplate('rules.php');
            break;
        default:
            App::redirect(App::request()->getBaseUrl() . '/404');
    }
} else {
    App::view()->setTemplate('index.php');
}
Example #6
0
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 *
 * @module      System Tools
 * @author      Oleg (AlkatraZ) Kasyanov <*****@*****.**>
 * @version     v.1.0.0 2015-02-01
 */
@ini_set("max_execution_time", "600");
defined('MOBICMS') or die('Error: restricted access');
$user = App::user()->get();
if ($user->rights >= 7) {
    $sv_actions = ['counters' => 'counters.php', 'firewall' => 'firewall.php', 'languages' => 'languages.php', 'sitemap' => 'sitemap.php', 'system_settings' => 'system_settings.php'];
    $admin_actions = ['acl' => 'acl.php', 'links' => 'links.php', 'scanner' => 'scanner.php', 'smilies' => 'smilies.php', 'users_settings' => 'users_settings.php'];
    $common_actions = [];
    App::lng()->setDomain('admin');
    $query = App::router()->getQuery(0);
    $include = __DIR__ . '/includes/';
    if (!empty($query)) {
        if ($user->rights == 9 && isset($sv_actions[$query])) {
            $include .= $sv_actions[$query];
        } elseif ($user->rights >= 7 && isset($admin_actions[$query])) {
            $include .= $admin_actions[$query];
        } elseif (isset($common_actions[$query])) {
            $include .= $common_actions[$query];
        } else {
            $include = false;
        }
    } else {
        $include .= 'index.php';
    }
Example #7
0
 *
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 *
 * @module      User Profile
 * @author      Oleg (AlkatraZ) Kasyanov <*****@*****.**>
 * @version     v.1.0.0 2015-02-01
 */
defined('MOBICMS') or die('Error: restricted access');
$public_actions = ['reputation' => 'reputation.php'];
$personal_actions = ['option' => 'option.php', 'option/avatar' => 'option_avatar.php', 'option/avatar/animation' => 'option_avatar_animation.php', 'option/avatar/delete' => 'option_avatar_delete.php', 'option/avatar/gravatar' => 'option_avatar_gravatar.php', 'option/avatar/image' => 'option_avatar_image.php', 'option/edit' => 'option_edit.php', 'option/email' => 'option_email.php', 'option/language' => 'option_language.php', 'option/nickname' => 'option_nickname.php', 'option/password' => 'option_password.php', 'option/rank' => 'option_rank.php', 'option/settings' => 'option_settings.php', 'option/theme' => 'option_theme.php'];
App::lng()->setDomain('profile');
$query = App::router()->getQuery();
$user = App::user()->get();
$include = __DIR__ . '/includes/';
if (isset($query[0])) {
    try {
        if (!ctype_digit($query[0]) || $query[0] < 1) {
            throw new Exception('Invalid data');
        }
        $profile = App::user()->findById($query[0]);
        App::registerInstance($profile, 'profile');
        if (isset($query[1])) {
            $act = implode('/', array_slice($query, 1));
            if (($user->rights == 9 || $user->rights == 7 && $user->rights > $profile->rights || App::user()->isValid() && $user->id == $profile->id) && isset($personal_actions[$act])) {
                $include .= $personal_actions[$act];
            } elseif (isset($public_actions[$act])) {
Example #8
0
/**
 * Plural version of _d()
 *
 * @param string      $singular
 * @param string      $plural
 * @param string      $count
 * @param null|string $domain
 * @return string
 */
function _dn($singular, $plural, $count, $domain)
{
    return App::lng()->dngettext($singular, $plural, $count, $domain);
}
Example #9
0
 *
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 *
 * @module      News
 * @author      Oleg (AlkatraZ) Kasyanov <*****@*****.**>
 * @version     v.1.0.0 2015-02-01
 */
defined('MOBICMS') or die('Error: restricted access');
$admin_actions = ['add' => 'add.php', 'admin' => 'admin.php', 'clean' => 'clean.php', 'delete' => 'delete.php', 'edit' => 'edit.php'];
$common_actions = [];
App::lng()->setModule('news');
$query = App::router()->getQuery(0);
$include = __DIR__ . '/includes/';
if (!empty($query)) {
    if (App::user()->get()->rights >= 7 && isset($admin_actions[$query])) {
        $include .= $admin_actions[$query];
    } elseif (isset($common_actions[$query])) {
        $include .= $common_actions[$query];
    } else {
        $include = false;
    }
} else {
    $include .= 'index.php';
}
if ($include && is_file($include)) {
    require_once $include;
Example #10
0
 *
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 *
 * @module      News
 * @author      Oleg (AlkatraZ) Kasyanov <*****@*****.**>
 * @version     v.1.0.0 2015-02-01
 */
defined('MOBICMS') or die('Error: restricted access');
$admin_actions = ['add' => 'add.php', 'admin' => 'admin.php', 'clean' => 'clean.php', 'delete' => 'delete.php', 'edit' => 'edit.php'];
$common_actions = [];
App::lng()->setDomain('news');
$query = App::router()->getQuery(0);
$include = __DIR__ . '/includes/';
if (!empty($query)) {
    if (App::user()->get()->rights >= 7 && isset($admin_actions[$query])) {
        $include .= $admin_actions[$query];
    } elseif (isset($common_actions[$query])) {
        $include .= $common_actions[$query];
    } else {
        $include = false;
    }
} else {
    $include .= 'index.php';
}
if ($include && is_file($include)) {
    require_once $include;