Example #1
0
 public static function newInstance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
/**
 * Gets the complete url of a given js's file
 *
 * @param string $file the js's file
 * @return string
 */
function osc_current_admin_theme_js_url($file = '')
{
    return AdminThemes::newInstance()->getCurrentThemeJs() . $file;
}
Example #3
0
require_once LIB_PATH . 'osclass/frm/Language.form.class.php';
require_once LIB_PATH . 'osclass/frm/SendFriend.form.class.php';
require_once LIB_PATH . 'osclass/frm/Alert.form.class.php';
require_once LIB_PATH . 'osclass/frm/Field.form.class.php';
require_once LIB_PATH . 'osclass/frm/Admin.form.class.php';
require_once LIB_PATH . 'osclass/frm/ManageItems.form.class.php';
require_once LIB_PATH . 'osclass/frm/BanRule.form.class.php';
require_once LIB_PATH . 'osclass/functions.php';
require_once LIB_PATH . 'osclass/helpers/hAdminMenu.php';
define('__OSC_LOADED__', true);
// Moved from BaseModel, since we need some session magic on index.php;)
Session::newInstance()->session_start();
if (OC_ADMIN) {
    // init admin menu
    AdminMenu::newInstance()->init();
    $functions_path = AdminThemes::newInstance()->getCurrentThemePath() . 'functions.php';
    if (file_exists($functions_path)) {
        require_once $functions_path;
    }
} else {
    // init Rewrite class only if it's the frontend
    Rewrite::newInstance()->init();
}
if (osc_timezone() != '') {
    date_default_timezone_set(osc_timezone());
}
function osc_show_maintenance()
{
    if (defined('__OSC_MAINTENANCE__')) {
        ?>
        <div id="maintenance" name="maintenance">
Example #4
0
 *     modify it under the terms of the GNU Affero General Public License
 *     as published by the Free Software Foundation, either version 3 of
 *            the License, or (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful, but
 *         WITHOUT ANY WARRANTY; without even the implied warranty of
 *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *             GNU Affero General Public License for more details.
 *
 *      You should have received a copy of the GNU Affero General Public
 * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
define('ABS_PATH', dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . '/');
define('OC_ADMIN', true);
require_once ABS_PATH . 'oc-load.php';
$adminThemes = new AdminThemes();
$functions_path = $adminThemes->getCurrentThemePath() . 'functions.php';
if (file_exists($functions_path)) {
    require_once $functions_path;
}
if (file_exists(ABS_PATH . '.maintenance')) {
    define('__OSC_MAINTENANCE__', true);
}
switch (Params::getParam('page')) {
    case 'items':
        require_once osc_admin_base_path() . 'items.php';
        $do = new CAdminItems();
        $do->doModel();
        break;
    case 'comments':
        require_once osc_admin_base_path() . 'comments.php';