コード例 #1
0
 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();
 }
コード例 #2
0
ファイル: Trash.php プロジェクト: Bouhnosaure/Typesetter
 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();
 }
コード例 #3
0
ファイル: Menu.php プロジェクト: Bouhnosaure/Typesetter
 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));
 }
コード例 #4
0
 public function __construct($args)
 {
     global $langmessage;
     parent::__construct($args);
     $this->page->ajaxReplace = array();
     //add examples to smtp_hosts
     $langmessage['about_config']['smtp_hosts'] .= 'ssl://smtp.gmail.com:465 ; tls://smtp.live.com:587';
     $langmessage['about_config']['showgplink'] = 'Showing the "powered by" link on your site is a great way to support ' . CMS_NAME . ' CMS.';
     $langmessage['about_config']['history_limit'] = 'Max: ' . gp_backup_limit;
     $this->variables = array('general_settings' => false, 'title' => '', 'keywords' => '', 'desc' => 'textarea', 'Interface' => false, 'colorbox_style' => array('example1' => 'Example 1', 'example2' => 'Example 2', 'example3' => 'Example 3', 'example4' => 'Example 4', 'example5' => 'Example 5'), 'language' => '', 'langeditor' => '', 'showsitemap' => 'boolean', 'showlogin' => 'boolean', 'showgplink' => 'boolean', 'Performance' => false, 'maximgarea' => 'integer', 'maxthumbsize' => 'integer', 'auto_redir' => 'integer', 'history_limit' => 'integer', 'HTML_Tidy' => '', 'Report_Errors' => 'boolean', 'combinejs' => 'boolean', 'combinecss' => 'boolean', 'etag_headers' => 'boolean', 'resize_images' => 'boolean', 'space_char' => array('_' => 'Undersorce "_"', '-' => 'Dash "-"'), 'contact_config' => false, 'toemail' => '', 'toname' => '', 'from_address' => '', 'from_name' => '', 'from_use_user' => 'boolean', 'require_email' => '', 'contact_advanced' => false, 'mail_method' => '', 'sendmail_path' => '', 'smtp_hosts' => '', 'smtp_user' => '', 'smtp_pass' => 'password', 'reCaptcha' => false, 'recaptcha_public' => '', 'recaptcha_private' => '', 'recaptcha_language' => '');
 }
コード例 #5
0
ファイル: Classes.php プロジェクト: Bouhnosaure/Typesetter
 function __construct($args)
 {
     parent::__construct($args);
     $this->admin_link = \gp\tool::GetUrl('Admin/Classes');
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'SaveClasses':
             $this->SaveClasses();
             break;
     }
     $this->ClassesForm();
 }
コード例 #6
0
ファイル: Users.php プロジェクト: Bouhnosaure/Typesetter
 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();
 }
コード例 #7
0
ファイル: CKEditor.php プロジェクト: Bouhnosaure/Typesetter
 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>';
 }
コード例 #8
0
ファイル: Search.php プロジェクト: Bouhnosaure/Typesetter
 public function __construct($args)
 {
     global $langmessage, $dataDir;
     parent::__construct($args);
     $this->config_file = $dataDir . '/data/_site/config_search.php';
     $this->GetConfig();
     if ($this->Admin()) {
         return;
     }
     //admin popup or visitor
     $_REQUEST += array('q' => '');
     if (\gp\tool::LoggedIn() && isset($_REQUEST['gpx_content']) && $_REQUEST['gpx_content'] == 'gpabox') {
         $this->AdminSearch();
     } else {
         $this->Search();
     }
 }
コード例 #9
0
ファイル: Errors.php プロジェクト: Bouhnosaure/Typesetter
 function __construct($args)
 {
     parent::__construct($args);
     $sub_page = '';
     $parts = explode('/', $this->page->requested);
     if (count($parts) > 2) {
         $sub_page = $parts[2];
     }
     switch ($sub_page) {
         case 'Log':
             $this->ErrorLog();
             return;
         default:
             $this->FatalErrors();
             return;
     }
 }
コード例 #10
0
ファイル: Cache.php プロジェクト: Bouhnosaure/Typesetter
 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();
 }
コード例 #11
0
ファイル: Map.php プロジェクト: Bouhnosaure/Typesetter
 function __construct($args)
 {
     global $langmessage, $config;
     parent::__construct($args);
     /*
     An xml site map will not show any of the pages from dynamic add-ons
     ... which is precisely what the regular sitemap shows
     */
     if (isset($_GET['xml'])) {
         $this->xml();
         return;
     }
     $this->MultiSiteData();
     echo '<div class="sitemap_xml">';
     echo \gp\tool::Link('Special_Site_Map', 'XML', 'xml');
     echo '</div>';
     echo '<h2>';
     echo \gp\tool\Output::ReturnText('site_map');
     echo '</h2>';
     \gp\tool\Output::GetFullMenu();
 }
コード例 #12
0
ファイル: Galleries.php プロジェクト: Bouhnosaure/Typesetter
 public function __construct($args)
 {
     parent::__construct($args);
     $this->galleries = self::GetData();
     $this->GenerateOutput();
 }