コード例 #1
0
ファイル: resetdefaults.php プロジェクト: spacequad/glfusion
$mode = isset($_POST['submit']) ? COM_applyFilter($_POST['submit']) : '';
if ($mode == $LANG_MG01['cancel']) {
    echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
    exit;
}
switch ($step) {
    case 'two':
        $ftp_path = $_CONF['path'] . 'plugins/mediagallery/uploads/';
        $tmp_path = $_CONF['path'] . 'plugins/mediagallery/tmp/';
        require_once $_CONF['path'] . 'plugins/mediagallery/sql/sql_defaults.php';
        // Insert default configuration
        COM_errorLog("Media Gallery: Restoring system defaults", 1);
        for ($i = 1; $i <= count($_SQL_DEF); $i++) {
            DB_query(current($_SQL_DEF));
            if (DB_error()) {
                COM_errorLog("Error inserting Media Gallery Defaults: " . curent($_SQL_DEF), 1);
            }
            next($_SQL_DEF);
        }
        COM_errorLog("Media Gallery: Success - default data added to Media Gallery tables", 1);
        echo COM_refresh($_MG_CONF['admin_url'] . 'index.php?msg=9');
        exit;
    default:
        $T = new Template($_MG_CONF['template_path'] . '/admin');
        $T->set_file(array('admin' => 'administration.thtml'));
        $B = new Template($_MG_CONF['template_path'] . '/admin');
        $B->set_file(array('admin' => 'thumbs.thtml'));
        $B->set_var('site_url', $_CONF['site_url']);
        $B->set_var('site_admin_url', $_CONF['site_admin_url']);
        // display the album list...
        $B->set_var(array('lang_title' => $LANG_MG01['reset_defaults'], 's_form_action' => $_MG_CONF['admin_url'] . 'resetdefaults.php?step=two', 'lang_next' => $LANG_MG01['next'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_details' => $LANG_MG01['reset_defaults_details']));
コード例 #2
0
 private function getError($e)
 {
     if ($e instanceof ValidatorException) {
         $error = curent($e->getErrors());
         return $error[0];
     } elseif ($message = $e->getMessage()) {
         return $message;
     }
     return "UNKNOWN ERROR";
 }