public function __construct($args)
 {
     global $langmessage, $config, $contact_message_sent, $message_send_attempt;
     parent::__construct($args);
     $this->sent = $contact_message_sent;
     if (empty($config['toemail'])) {
         if (\gp\tool::LoggedIn()) {
             $url = \gp\tool::GetUrl('Admin_Configuration');
             msg($langmessage['enable_contact'], $url);
         }
         echo $langmessage['not_enabled'];
         return;
     }
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'gp_send_message':
             if (!$message_send_attempt) {
                 $message_send_attempt = true;
                 if (!$this->sent && $this->SendMessage()) {
                     $this->sent = $contact_message_sent = true;
                     break;
                 }
             }
         default:
             break;
     }
     $this->ShowForm();
 }
Beispiel #2
0
 function __construct($args)
 {
     global $langmessage;
     $this->page = $args['page'];
     $this->Init();
     \gp\tool\Editing::PrepAutoComplete();
     $cmd = \gp\tool::GetCommand();
     $show = true;
     switch ($cmd) {
         case 'save404':
             $show = $this->Save404();
             break;
         case 'edit404':
             $this->Edit404();
             return;
         case 'editredir':
             $this->EditRedir();
             return;
         case 'saveredir':
             $this->SaveRedir();
             break;
         case 'updateredir':
             $this->UpdateRedir();
             break;
         case 'rmredir':
             $this->RmRedir();
             break;
         case 'newform':
             $this->RedirForm();
             return;
     }
     if ($show) {
         $this->Show();
     }
 }
Beispiel #3
0
 function Run()
 {
     if (!$this->CheckPHP()) {
         echo $this->output_phpcheck;
         return;
     }
     $cmd = \gp\tool::GetCommand();
     $show = true;
     switch ($cmd) {
         case 'checkremote':
             $this->DoRemoteCheck(true);
             break;
         case 'update':
             if (gp_remote_update && $this->UpdateCMS()) {
                 $show = false;
             }
             break;
     }
     if ($show) {
         $this->ShowStatus();
         echo '<h2>Status</h2>';
         $this->CheckStatus();
         echo $this->output_phpcheck;
     }
 }
Beispiel #4
0
 public function __construct()
 {
     global $langmessage;
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'continue':
             $this->uninstall();
             break;
         case 'restore':
             $this->restore();
             break;
     }
     echo '<h2>Uninstall Preparation</h2>';
     echo '<form class="renameform" action="' . \gp\tool::GetUrl('Admin/Uninstall') . '" method="post">';
     echo '<p>';
     echo 'For some installations, you won\'t be able to delete ' . CMS_NAME . '\'s data files from your server untill the access permissions have been changed. ';
     echo ' This script will change file permissions for files and folders in the /data directory to 0777.';
     echo ' <br/><em>You should not continue unless you plan on deleting all ' . CMS_NAME . ' files from your server.</em>';
     echo '<input type="hidden" name="cmd" value="continue" />';
     echo ' <input type="submit" name="aaa" value="' . $langmessage['continue'] . '" class="gpsubmit"/>';
     //echo ' <input type="submit" name="cmd" value="'.$langmessage['cancel'].'" />';
     echo '</p>';
     echo '</form>';
     echo '<h2>Change Your Mind?</h2>';
     echo '<form class="renameform" action="' . \gp\tool::GetUrl('Admin/Uninstall') . '" method="post">';
     echo 'You can restore the file permissions for added security here: ';
     echo '<input type="hidden" name="cmd" value="restore" />';
     echo '<input type="submit" name="aaa" value="' . $langmessage['restore'] . '" class="gpsubmit"/>';
     echo '</form>';
 }
Beispiel #5
0
 public function __construct($args)
 {
     global $langmessage;
     parent::__construct($args);
     $this->page->head_js[] = '/include/js/admin/trash.js';
     $this->trash_files = self::TrashFiles();
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'RestoreDeleted':
             $this->RestoreDeleted();
             break;
         case 'DeleteFromTrash':
             $this->DeleteFromTrash();
             break;
     }
     //view a trash file
     $parts = explode('/', $this->page->requested);
     if (count($parts) > 2) {
         $title = $parts[2];
         if (isset($this->trash_files[$title])) {
             $this->ViewTrashFile($title);
             return;
         }
     }
     //view all trash files
     $this->Trash();
 }
Beispiel #6
0
 public function RunScript()
 {
     global $config, $gpLayouts, $langmessage;
     $cmd = \gp\tool::GetCommand();
     //set current layout
     $this->curr_layout = $config['gpLayout'];
     if (isset($_REQUEST['layout'])) {
         $this->curr_layout = $_REQUEST['layout'];
     }
     if (!array_key_exists($this->curr_layout, $gpLayouts)) {
         message($langmessage['OOPS'] . ' (Invalid Layout)');
         $cmd = '';
     }
     $this->SetLayoutArray();
     //Installation
     $this->cmds['RemoteInstall'] = '';
     $this->cmds['RemoteInstallConfirmed'] = 'DefaultDisplay';
     $this->cmds['UpgradeTheme'] = 'DefaultDisplay';
     //Copy, Delete
     $this->cmds['CopyLayoutPrompt'] = '';
     $this->cmds['CopyLayout'] = 'DefaultDisplay';
     $this->cmds['DeleteLayout'] = 'DefaultDisplay';
     //Reviews
     $this->cmds['SendAddonReview'] = '';
     $this->cmds['ReviewAddonForm'] = '';
     $this->LayoutCommands();
     $this->RunCommands($cmd);
 }
Beispiel #7
0
 public function RunScript()
 {
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         //remove
         case 'MenuRemove':
             $this->MenuRemove();
             $this->Redirect();
             break;
             //rename
         //rename
         case 'MenuRenamePrompt':
             $this->MenuRenamePrompt();
             return;
         case 'MenuRename':
             $this->MenuRename();
             $this->Redirect();
             break;
             //new
         //new
         case 'NewMenuPrompt':
             $this->NewMenuPrompt();
             return;
         case 'NewMenuCreate':
             $this->NewMenuCreate();
             $this->Redirect();
             break;
     }
     $this->ShowForm();
 }
Beispiel #8
0
 public function GetGpxContent()
 {
     $this->head .= "\n<script type=\"text/javascript\">var IE_LT_10 = false;</script><!--[if lt IE 10]>\n<script type=\"text/javascript\">IE_LT_10=true;</script>\n<![endif]-->";
     $this->head_js[] = '/include/js/login.js';
     $this->head_js[] = '/include/js/md5_sha.js';
     $this->head_js[] = '/include/thirdparty/js/jsSHA.js';
     $this->css_admin[] = '/include/css/login.css';
     $_POST += array('username' => '');
     $this->admin_js = true;
     \gp\tool\Session::cookie('g', 2);
     $this->BrowserWarning();
     $this->JavascriptWarning();
     echo '<div class="req_script nodisplay" id="login_container">';
     echo '<table><tr><td>';
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'send_password':
             if ($this->SendPassword()) {
                 $this->LoginForm();
             } else {
                 $this->FogottenPassword();
             }
             break;
         case 'forgotten':
             $this->FogottenPassword();
             break;
         default:
             $this->LoginForm();
             break;
     }
     echo '</td></tr></table>';
     echo '</div>';
 }
Beispiel #9
0
 public function __construct($args)
 {
     global $langmessage, $config;
     parent::__construct($args);
     $this->section_types = \gp\tool\Output\Sections::GetTypes();
     $this->page->ajaxReplace = array();
     $this->page->css_admin[] = '/include/css/admin_menu_new.css';
     $this->page->head_js[] = '/include/thirdparty/js/nestedSortable.js';
     $this->page->head_js[] = '/include/thirdparty/js/jquery_cookie.js';
     $this->page->head_js[] = '/include/js/admin_menu_new.js';
     $this->max_level_index = max(3, gp_max_menu_level - 1);
     $this->page->head_script .= 'var max_level_index = ' . $this->max_level_index . ';';
     $this->avail_menus['gpmenu'] = $langmessage['Main Menu'] . ' / ' . $langmessage['site_map'];
     $this->avail_menus['all'] = $langmessage['All Pages'];
     $this->avail_menus['hidden'] = $langmessage['Not In Main Menu'];
     $this->avail_menus['nomenus'] = $langmessage['Not In Any Menus'];
     $this->avail_menus['search'] = $langmessage['search pages'];
     if (isset($config['menus'])) {
         foreach ($config['menus'] as $id => $menu_label) {
             $this->avail_menus[$id] = $menu_label;
         }
     }
     //read cookie settings
     if (isset($_COOKIE['gp_menu_prefs'])) {
         parse_str($_COOKIE['gp_menu_prefs'], $this->cookie_settings);
     }
     $this->SetMenuID();
     $this->SetMenuArray();
     $this->SetCollapseSettings();
     $this->SetQueryInfo();
     $cmd = \gp\tool::GetCommand();
     $this->cmd = \gp\tool\Plugins::Filter('MenuCommand', array($cmd));
 }
Beispiel #10
0
 public function RunScript()
 {
     global $gp_index, $langmessage;
     $scriptinfo = self::GetScriptInfo($this->title);
     if ($scriptinfo === false) {
         switch ($this->title) {
             case 'Special_ExtraJS':
                 $this->ExtraJS();
                 //dies
         }
         $this->Error_404($this->title);
         return;
     }
     $this->gp_index = $gp_index[$this->title];
     $this->TitleInfo = $scriptinfo;
     if (!$this->CheckVisibility()) {
         return false;
     }
     //allow addons to affect page actions and how a page is displayed
     $cmd = \gp\tool::GetCommand();
     $cmd_after = \gp\tool\Plugins::Filter('PageRunScript', array($cmd));
     if ($cmd !== $cmd_after) {
         $cmd = $cmd_after;
         if ($cmd === 'return') {
             return;
         }
     }
     if (\gp\tool::LoggedIn() && \gp\admin\Tools::HasPermission('Admin_Menu')) {
         $this->cmds['RenameForm'] = '\\gp\\Page\\Rename::RenameForm';
         $this->cmds['RenameFile'] = '\\gp\\Page\\Rename::RenamePage';
         $this->cmds['ToggleVisibility'] = array('\\gp\\Page\\Visibility::TogglePage', 'DefaultDisplay');
         $this->cmds['ManageSections'] = '\\gp\\Page\\Edit::ManageSections';
     }
     $this->RunCommands($cmd);
 }
Beispiel #11
0
 public function RunScript()
 {
     $this->cmds['EditText'] = '';
     $this->cmds['SaveText'] = 'ReturnHeader';
     $this->cmds['AddonTextForm'] = '';
     $this->cmds['SaveAddonText'] = 'ReturnHeader';
     $cmd = \gp\tool::GetCommand();
     $this->RunCommands($cmd);
 }
Beispiel #12
0
 /**
  * Display form for selecting classes
  *
  */
 function ClassesForm()
 {
     global $dataDir, $langmessage;
     echo '<h2 class="hmargin">Manage Classes</h2>';
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'LoadDefault':
             $classes = self::Defaults();
             break;
         case 'LoadBootstrap':
             $classes = self::Bootstrap();
             break;
         default:
             $classes = self::GetClasses();
             break;
     }
     $classes[] = array('names' => '', 'desc' => '');
     $this->page->jQueryCode .= '$(".sortable_table").sortable({items : "tr",handle: "td"});';
     // FORM
     echo '<form action="' . $this->admin_link . '" method="post">';
     echo '<table class="bordered full_width sortable_table">';
     echo '<thead><tr><th>className(s)</th><th>Description (optional)</th></tr></thead>';
     echo '<tbody>';
     foreach ($classes as $key => $classArray) {
         echo '<tr><td>';
         echo '<img alt="" src="' . \gp\tool::GetDir('/include/imgs/drag_handle.gif') . '" /> &nbsp; ';
         echo '<input size="16" class="gpinput" type="text" name="class_names[]" value="' . $classArray['names'] . '"/>';
         echo '</td><td>';
         echo '<input size="64" class="gpinput" type="text" name="class_desc[]" value="' . $classArray['desc'] . '"/> ';
         echo '<a class="gpbutton rm_table_row" title="Remove Item" data-cmd="rm_table_row">&times;</a>';
         echo '</td></tr>';
     }
     echo '<tr><td colspan="3">';
     echo '<a data-cmd="add_table_row">Add Row</a>';
     echo '</td></tr>';
     echo '</tbody>';
     echo '</table>';
     echo '<br/>';
     // SAVE / CANCEL BUTTONS
     echo '<button type="submit" name="cmd" value="SaveClasses" class="gpsubmit">' . $langmessage['save'] . '</button>';
     echo '<button type="submit" name="cmd" value="" class="gpcancel">' . $langmessage['cancel'] . '</button>';
     echo '<div style="margin-top:2em; border:1px solid #ccc; background:#fafafa; border-radius:3px; padding:12px;">';
     echo 'CSS classNames you set here will be easily selectable in the Section Attributes dialog.';
     echo '<ul>';
     echo '<li>Single classNames (like <em>gpRow</em>) will show as checkboxes</li>';
     echo '<li>Multiple, space separated classNames (like <em>gpCol-1 gpCol-2 gpCol-3 [&hellip;]</em> will show as checkable dropdown list.</li>';
     echo '<li>The list is drag&rsquo;n&rsquo;drop sortable.</li>';
     echo '</ul><hr/>';
     echo '</form>';
     //$tooltip = $isBootswatchTheme ? ":-) Your current default theme is Bootstrap based - cleared for Take Off!" : ":-/ You will have to use a Bootstrap based theme for this preset!";
     echo '<p>';
     echo '<form action="' . $this->admin_link . '" method="get">';
     echo '<button class="gpbutton" name="cmd" value="LoadBootstrap">Load the Bootstrap Preset</button> ';
     echo '<button class="gpbutton" name="cmd" value="LoadDefault">Load the Default Preset</button>';
     echo '</p>';
     echo '</div>';
 }
 public function RunScript()
 {
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'save_config':
             $this->SaveConfig();
             break;
     }
     $this->showForm();
 }
Beispiel #14
0
 public function __construct($args)
 {
     $this->galleries = self::GetData();
     $this->page = $args['page'];
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'newdrag':
             $this->NewDrag();
             return;
     }
     $this->EditGalleries();
 }
Beispiel #15
0
 public function __construct($args)
 {
     global $langmessage;
     parent::__construct($args);
     $this->page->head_js[] = '/include/js/admin_users.js';
     //set possible_permissions
     $scripts = \gp\admin\Tools::AdminScripts();
     foreach ($scripts as $script => $info) {
         if (!isset($info['label'])) {
             continue;
         }
         $script = str_replace('/', '_', $script);
         $this->possible_permissions[$script] = $info['label'];
     }
     $this->GetUsers();
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'save_file_permissions':
             if ($this->SaveFilePermissions()) {
                 return;
             }
         case 'file_permissions':
             $this->FilePermissions();
             return;
         case 'newuser':
             if ($this->CreateNewUser()) {
                 break;
             }
         case 'newuserform':
             $this->NewUserForm();
             return;
         case 'rm':
             $this->RmUserConfirmed();
             break;
         case 'resetpass':
             if ($this->ResetPass()) {
                 break;
             }
         case 'changepass':
             $this->ChangePass();
             return;
         case 'SaveChanges':
             if ($this->SaveChanges()) {
                 break;
             }
         case 'details':
             $this->ChangeDetails();
             return;
     }
     $this->ShowForm();
 }
Beispiel #16
0
 function __construct($args)
 {
     global $langmessage;
     parent::__construct($args);
     $this->page->css_admin[] = '/include/css/addons.css';
     //$this->page->head_js[] = '/include/js/admin_ckeditor.js';
     $this->Init();
     // subpage
     $this->subpages = array('' => $langmessage['Manage Plugins'], 'Config' => $langmessage['configuration'], 'Example' => 'Example');
     $parts = explode('/', $this->page->requested);
     if (count($parts) > 2 && array_key_exists($parts[2], $this->subpages)) {
         $this->current_subpage = $parts[2];
     }
     // commands
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'save_custom_config':
             $this->SaveCustomConfig();
             break;
         case 'upload_plugin':
             $this->UploadPlugin();
             break;
         case 'rmplugin':
             $this->RemovePlugin();
             break;
     }
     echo '<style>';
     echo 'body #gp_admin_html pre.json{font-family:monospace;line-height:180%;font-size:12px}';
     echo '.custom_config{width:600px;height:200px;}';
     echo '</style>';
     $this->Heading();
     switch ($this->current_subpage) {
         case 'Example':
             $this->Example();
             break;
         case 'Config':
             $this->CustomConfigForm();
             $this->DisplayCurrent();
             break;
         default:
             $this->PluginForm();
             break;
     }
     echo '<br/><p>';
     echo '<a href="http://ckeditor.com" target="_blank">CKEditor</a> is ' . CMS_NAME . '\'s text editor of choice because it is a powerful tool with <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html" target="_blank">many configuration options</a> and a growing <a href="http://ckeditor.com/addons/plugins" target="_blank">list of plugins</a>. ';
     echo '</p>';
 }
Beispiel #17
0
 /**
  * Display a list of fatal errors
  *
  */
 function FatalErrors()
 {
     global $dataDir;
     echo '<h2 class="hmargin">';
     echo 'Fatal Errors';
     echo ' <span> | </span> ';
     echo \gp\tool::Link('Admin/Errors/Log', 'Error Log');
     echo '</h2>';
     //actions
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'ClearError':
             self::ClearError($_REQUEST['hash']);
             break;
         case 'ClearAll':
             self::ClearAll();
             break;
     }
     //get unique errors
     $dir = $dataDir . '/data/_site';
     $files = scandir($dir);
     $errors = array();
     foreach ($files as $file) {
         if (strpos($file, 'fatal_') === false) {
             continue;
         }
         $full_path = $dir . '/' . $file;
         $md5 = md5_file($full_path);
         $errors[$md5] = $full_path;
     }
     echo '<p>';
     if (count($errors)) {
         echo 'Found ' . count($errors) . ' Unique Error(s) - ';
         echo \gp\tool::Link('Admin/Errors', 'Clear All Errors', 'cmd=ClearAll', 'data-cmd="cnreq"', 'ClearErrors');
     } else {
         echo 'Hooray! No fatal errors found';
     }
     echo '</p>';
     echo '<hr/>';
     //display errors
     foreach ($errors as $md5 => $error_file) {
         self::DisplayFatalError($error_file);
     }
 }
Beispiel #18
0
 function RunScript()
 {
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'LocalInstall':
             $this->LocalInstall();
             break;
         case 'RemoteInstall':
             $this->RemoteInstall();
             return;
         case 'RemoteInstallConfirmed':
             $this->RemoteInstallConfirmed();
             break;
         case 'SendAddonReview':
         case 'ReviewAddonForm':
             $this->AdminAddonRating();
             if ($this->ShowRatingText) {
                 return;
             }
             break;
         case 'enable':
         case 'disable':
             $this->GadgetVisibility($cmd);
             return;
         case 'uninstall':
             $this->Uninstall();
             return;
         case 'confirm_uninstall':
             $this->Confirm_Uninstall();
             break;
         case 'history':
             $this->History();
             return;
     }
     //single addon
     $request_parts = explode('/', $this->page->requested);
     if (count($request_parts) > 2) {
         $this->ShowAddon($request_parts[2]);
         return;
     }
     $this->Select();
     $this->CleanAddonFolder();
 }
Beispiel #19
0
 public function __construct($args)
 {
     global $gpAdmin, $langmessage;
     parent::__construct($args);
     //only need to return messages if it's ajax request
     $this->page->ajaxReplace = array();
     $this->GetUsers();
     $this->username = $gpAdmin['username'];
     if (!isset($this->users[$this->username])) {
         msg($langmessage['OOPS']);
         return;
     }
     $this->user_info = $this->users[$this->username];
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'changeprefs':
             $this->DoChange();
             break;
     }
     $this->Form();
 }
Beispiel #20
0
 public function __construct($args)
 {
     global $langmessage, $dataDir;
     parent::__construct($args);
     $this->cache_dir = $dataDir . '/data/_cache';
     $this->AllFiles();
     echo '<h2>' . $langmessage['Resource Cache'] . '</h2>';
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'ViewFile':
             $this->ViewFile();
             return;
         case 'DeleteFile':
             $this->DeleteFile();
             break;
         case 'EmptyResourceCache':
             $this->EmptyResourceCache();
             break;
     }
     $this->ShowFiles();
 }
Beispiel #21
0
 /**
  * Show available themes and style variations
  *
  */
 public function ShowAvailable()
 {
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'preview':
         case 'preview_iframe':
         case 'newlayout':
         case 'addlayout':
             if ($this->NewLayout($cmd)) {
                 return;
             }
             break;
         case 'DeleteTheme':
             $this->DeleteTheme();
             $this->GetPossible();
             break;
     }
     $this->GetAddonData();
     $this->ShowHeader();
     $this->AvailableList();
     $this->InvalidFolders();
 }
Beispiel #22
0
 public function RunScript()
 {
     // area specific commands
     if (!is_null($this->file)) {
         $this->cmds['DeleteArea'] = 'DefaultDisplay';
         $this->cmds['EditExtra'] = '';
         $this->cmds['PublishDraft'] = 'DefaultDisplay';
         $this->cmds['PublishAjax'] = '';
         $this->cmds['PreviewText'] = '';
         $this->cmds['SaveText'] = 'EditExtra';
         $this->cmds['gallery_folder'] = 'GalleryImages';
         $this->cmds['gallery_images'] = 'GalleryImages';
         $this->cmds['new_dir'] = '\\gp\\tool\\Editing::NewDirForm';
         /* inline editing */
         $this->cmds['save'] = 'SectionEdit';
         $this->cmds['save_inline'] = 'SectionEdit';
         $this->cmds['preview'] = 'SectionEdit';
         $this->cmds['include_dialog'] = 'SectionEdit';
         $this->cmds['InlineEdit'] = 'SectionEdit';
     }
     $this->cmds['NewSection'] = 'DefaultDisplay';
     $cmd = \gp\tool::GetCommand();
     $this->RunCommands($cmd);
 }
Beispiel #23
0
 public function __construct()
 {
     global $langmessage, $dataDir;
     $this->server_name = \gp\tool::ServerName(true);
     //get current rules
     $this->rule_file_name = self::IIS() ? 'web.config' : '.htaccess';
     $this->rule_file = $dataDir . '/' . $this->rule_file_name;
     if (file_exists($this->rule_file)) {
         $this->orig_rules = file_get_contents($this->rule_file);
     }
     $this->FileSystem = \gp\tool\FileSystem::init($this->rule_file);
     $this->WWWAvail();
     echo '<h2>' . $langmessage['permalink_settings'] . '</h2>';
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'continue':
             if (!$this->SaveHtaccess()) {
                 break;
             }
         default:
             $this->ShowForm();
             break;
     }
 }
Beispiel #24
0
 public function __construct()
 {
     global $languages, $install_language, $langmessage;
     //language preferences
     $install_language = 'en';
     if (isset($_GET['lang']) && isset($languages[$_GET['lang']])) {
         $install_language = $_GET['lang'];
     } elseif (isset($_COOKIE['lang']) && isset($languages[$_COOKIE['lang']])) {
         $install_language = $_COOKIE['lang'];
     }
     setcookie('lang', $install_language);
     \gp\tool::GetLangFile('main.inc', $install_language);
     echo '<h1>';
     echo $langmessage['Installation'];
     echo ' - v' . gpversion;
     echo '</h1>';
     $installed = false;
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'Continue':
             $this->FTP_Prepare();
             break;
         case 'Install':
             $installed = $this->Install_Normal();
             break;
     }
     if (!$installed) {
         $this->LanguageForm();
         $this->CheckFolders();
     } else {
         $this->Installed();
     }
 }
Beispiel #25
0
 /**
  * Show the default admin page
  *
  */
 private function AdminPanel()
 {
     global $langmessage;
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'embededcheck':
             new \gp\admin\Update('embededcheck');
             return;
         case 'autocomplete-titles':
             $opts = array('var_name' => false);
             echo \gp\tool\Editing::AutoCompleteValues(false, $opts);
             die;
     }
     $this->head_js[] = '/include/js/auto_width.js';
     echo '<h2>' . $langmessage['administration'] . '</h2>';
     echo '<div id="adminlinks2">';
     \gp\admin\Tools::AdminPanelLinks(false);
     echo '</div>';
 }
Beispiel #26
0
 function RunScript()
 {
     if (!$this->SetVars()) {
         return;
     }
     //allow addons to effect page actions and how a page is displayed
     $cmd = \gp\tool::GetCommand();
     $cmd_after = \gp\tool\Plugins::Filter('PageRunScript', array($cmd));
     if ($cmd !== $cmd_after) {
         $cmd = $cmd_after;
         if ($cmd === 'return') {
             return;
         }
     }
     $this->GetFile();
     $this->contentBuffer = \gp\tool\Output\Sections::Render($this->file_sections, $this->title, $this->file_stats);
 }
Beispiel #27
0
 /**
  * Manage addon ratings
  *
  */
 public function AdminAddonRating()
 {
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'SendAddonReview':
             if ($this->SendAddonReview()) {
                 return;
             }
     }
     $this->ReviewAddonForm();
 }
Beispiel #28
0
 public function RunScript()
 {
     global $langmessage;
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'do_export':
             $this->DoExport();
             $this->SetExported();
             break;
         case 'delete':
             $this->DeleteConfirmed();
             $this->SetExported();
             break;
         case 'revert_confirmed':
         case 'revert':
             if ($this->Revert($cmd)) {
                 return;
             }
             break;
         case 'revert_clean':
             $this->RevertClean();
             break;
     }
     echo '<h2>' . $langmessage['Export'] . '</h2>';
     echo $langmessage['Export About'];
     echo $this->iframe;
     $this->ExportForm();
     echo '<br/>';
     $this->Exported();
 }
Beispiel #29
0
 /**
  * Perform various section editing commands
  * @return bool
  */
 public function SectionEdit()
 {
     global $langmessage, $page;
     $section_num = $_REQUEST['section'];
     if (!is_numeric($section_num) || !isset($this->file_sections[$section_num])) {
         echo 'false;';
         return false;
     }
     $page->ajaxReplace = array();
     $cmd = \gp\tool::GetCommand();
     if (!\gp\tool\Editing::SectionEdit($cmd, $this->file_sections[$section_num], $section_num, $this->title, $this->file_stats)) {
         return false;
     }
     //save if the file was changed
     if (!$this->SaveThis()) {
         msg($langmessage['OOPS'] . ' (SE3)');
         return false;
     }
     $page->ajaxReplace[] = array('ck_saved', '', '');
     //update gallery information
     switch ($this->file_sections[$section_num]['type']) {
         case 'gallery':
             $this->GalleryEdited();
             break;
     }
     return true;
 }
Beispiel #30
0
 /**
  * Save user settings
  *
  */
 public static function SaveSetting()
 {
     global $gpAdmin;
     $cmd = \gp\tool::GetCommand('do');
     if (empty($cmd)) {
         return;
     }
     switch ($cmd) {
         case 'savegpui':
             self::SaveGPUI();
             //dies
     }
 }