Ejemplo n.º 1
0
 function ShowPost()
 {
     $cmd = common::GetCommand();
     switch ($cmd) {
         // inline editing
         case 'inlineedit':
             $this->InlineEdit();
             die;
         case 'save_inline':
         case 'save':
             $this->SaveInline();
             break;
             //close comments
         //close comments
         case 'closecomments':
             $this->ToggleComments(true, $this->post_id);
             break;
         case 'opencomments':
             $this->ToggleComments(false, $this->post_id);
             break;
             //commments
         //commments
         case 'delete_comment':
             $this->DeleteComment();
             break;
     }
     parent::ShowPost();
 }
Ejemplo n.º 2
0
 function MultiLang_Admin()
 {
     global $page;
     $this->Init();
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'title_settings_add':
         case 'title_settings_save':
             $this->TitleSettingsSave($cmd);
             $this->TitleSettings();
             return;
         case 'title_settings':
             $this->TitleSettings();
             return;
         case 'rmtitle':
             $this->RemoveTitle();
             $this->TitleSettings();
             return;
         case 'not_translated':
             $this->NotTranslated();
             break;
         case 'save_languages':
             $this->SaveLanguages();
         case 'languages':
             $this->SelectLanguages();
             break;
         default:
             $this->ShowStats();
             break;
     }
 }
Ejemplo n.º 3
0
 function admin_extra()
 {
     global $langmessage, $dataDir;
     $this->folder = $dataDir . '/data/_extra';
     $this->areas = gpFiles::ReadDir($this->folder);
     asort($this->areas);
     $cmd = common::GetCommand();
     $show = true;
     switch ($cmd) {
         case 'delete':
             $this->DeleteArea();
             break;
         case 'save':
             if ($this->SaveExtra()) {
                 break;
             }
         case 'edit':
             if ($this->EditExtra()) {
                 $show = false;
             }
             break;
         case 'rawcontent':
             $this->RawContent();
             break;
         case 'inlineedit':
             $this->InlineEdit();
             die;
     }
     if ($show) {
         $this->ShowExtras();
     }
 }
Ejemplo n.º 4
0
 function __construct()
 {
     global $langmessage;
     $this->Init();
     gp_edit::PrepAutoComplete();
     $cmd = common::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();
     }
 }
Ejemplo n.º 5
0
 function Example_Ajax()
 {
     global $page, $addonRelativeCode;
     //prepare the page
     $page->head_js[] = $addonRelativeCode . 'static/02_script.js';
     $page->admin_js = true;
     //get request parameters and execute any commands
     $string = '';
     if (isset($_REQUEST['string'])) {
         $string = $_REQUEST['string'];
     }
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'randomstring':
             $string = common::RandomString(10);
             break;
     }
     //display the form
     echo '<h2>Example Ajax Requests</h2>';
     echo '<form method="post" action="' . $page->title . '">';
     echo 'Text: <input type="text" name="string" value="' . htmlspecialchars($string) . '" size="30" />';
     echo ' <input type="submit" class="gpajax" value="Post Form Asynchronosly" /> ';
     echo common::Link($page->title, 'Get Random String', 'cmd=randomstring', 'name="gpajax"');
     echo '</form>';
     //output the $_REQUEST variable
     echo '<h3>Request</h3>';
     echo showArray($_REQUEST);
     //plugin example navigation
     gpPlugin::incl('navigation.php');
     PluginExampleNavigation();
 }
Ejemplo n.º 6
0
 function admin_missing()
 {
     global $langmessage;
     $this->Init();
     $cmd = common::GetCommand();
     $show = true;
     switch ($cmd) {
         case 'save404':
             $show = $this->Save404();
             break;
         case 'edit404':
             $this->Edit404();
             return;
         case 'saveredir':
             $this->SaveRedir();
             break;
         case 'updateredir':
             $this->UpdateRedir();
             break;
         case 'rmredir':
             $this->RmRedir();
             break;
     }
     if ($show) {
         $this->Show();
     }
 }
Ejemplo n.º 7
0
 function __construct()
 {
     global $langmessage, $page;
     $page->head_js[] = '/include/js/admin/trash.js';
     $this->trash_files = admin_trash::TrashFiles();
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'RestoreDeleted':
             $this->RestoreDeleted();
             break;
         case 'DeleteFromTrash':
             $this->DeleteFromTrash();
             break;
     }
     //view a trash file
     if (strpos($page->requested, '/') !== false) {
         $parts = explode('/', $page->requested, 2);
         $title = $parts[1];
         if (isset($this->trash_files[$title])) {
             $this->ViewTrashFile($title);
             return;
         }
     }
     //view all trash files
     $this->Trash();
 }
Ejemplo n.º 8
0
 public function __construct()
 {
     global $page, $langmessage, $addonFolderName;
     SimpleBlogCommon::Init();
     //get the post id
     if ($page->pagetype == 'special_display') {
         $this->post_id = $this->PostID($page->requested);
     }
     if (common::LoggedIn()) {
         $page->admin_links[] = array('Special_Blog', 'Blog Home');
         $page->admin_links[] = array('Admin_Blog', 'New Blog Post', 'cmd=new_form');
         $page->admin_links[] = array('Admin_Blog', 'Configuration');
         $page->admin_links[] = array('Admin_Theme_Content', $langmessage['editable_text'], 'cmd=addontext&addon=' . urlencode($addonFolderName), ' name="gpabox" ');
         $label = 'Number of Posts: ' . SimpleBlogCommon::$data['post_count'];
         $page->admin_links[$label] = '';
         $cmd = common::GetCommand();
         switch ($cmd) {
             //delete
             case 'deleteentry':
             case 'delete':
                 SimpleBlogCommon::Delete();
                 break;
         }
     }
     if ($this->post_id) {
         $this->ShowPost();
         return;
     }
     $this->ShowPage();
     if (common::LoggedIn() && !file_exists(self::$index_file)) {
         echo '<p>Congratulations on successfully installing Simple Blog for gpEasy.</p> ';
         echo '<p>You\'ll probably want to get started by ' . common::Link('Admin_Blog', 'creating a blog post', 'cmd=new_form') . '.</p>';
     }
 }
Ejemplo n.º 9
0
 function GetGpxContent()
 {
     $this->head .= "\n<script type=\"text/javascript\">var IE_LT_8 = false;</script><!--[if lt IE 8]>\n<script type=\"text/javascript\">IE_LT_8=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;
     includeFile('tool/sessions.php');
     gpsession::cookie('g', 2);
     $this->BrowserWarning();
     $this->JavascriptWarning();
     echo '<div class="req_script nodisplay" id="login_container">';
     echo '<table><tr><td>';
     $cmd = common::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>';
 }
Ejemplo n.º 10
0
 function __construct()
 {
     global $page, $langmessage, $config, $contact_message_sent, $message_send_attempt;
     $this->sent = $contact_message_sent;
     if (empty($config['toemail'])) {
         if (common::LoggedIn()) {
             $url = common::GetUrl('Admin_Configuration');
             msg($langmessage['enable_contact'], $url);
         }
         echo $langmessage['not_enabled'];
         return;
     }
     $cmd = common::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();
 }
Ejemplo n.º 11
0
 function Run()
 {
     if (!$this->CheckPHP()) {
         echo $this->output_phpcheck;
         return;
     }
     $cmd = common::GetCommand();
     $show = true;
     switch ($cmd) {
         case 'checkremote':
             $this->DoRemoteCheck(true);
             break;
         case 'update':
             if (gp_remote_update && $this->Update()) {
                 $show = false;
             }
             break;
     }
     if ($show) {
         $this->ShowStatus();
         echo '<h2>Status</h2>';
         $this->CheckStatus();
         echo $this->output_phpcheck;
     }
 }
Ejemplo n.º 12
0
 public function RunScript()
 {
     global $langmessage;
     $cmd = common::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['Import/Export'].'</h2>';
     echo '<h2>' . $langmessage['Export'] . '</h2>';
     echo $langmessage['Export About'];
     echo $this->iframe;
     $this->ExportForm();
     echo '<br/>';
     $this->Exported();
 }
Ejemplo n.º 13
0
 function Run()
 {
     echo '<div class="easy_comments_wrap">';
     echo '<h2>Comments</h2>';
     if (!$this->current_index) {
         echo '<p>Comments are not available for this page</p>';
         echo '</div>';
         return;
     }
     $cmd = common::GetCommand();
     $show = true;
     $comment_added = false;
     switch ($cmd) {
         //delete prompts
         case 'easy_comment_add':
             $comment_added = $this->CommentAdd();
             break;
         case 'easy_comment_rm':
             $this->CommentRm($cmd);
             break;
     }
     $this->ShowComments();
     if (!$comment_added) {
         $this->CommentForm();
     }
     echo '</div>';
 }
Ejemplo n.º 14
0
 function admin_port()
 {
     global $langmessage, $dataDir, $page;
     $this->export_dir = $dataDir . '/data/_exports';
     $this->temp_dir = $dataDir . '/data/_temp';
     $this->export_ini_file = $dataDir . '/data/_temp/Export.ini';
     $this->Init();
     $this->SetExported();
     $cmd = common::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['Import/Export'].'</h2>';
     echo '<h2>' . $langmessage['Export'] . '</h2>';
     echo $langmessage['Export About'];
     $this->ExportForm();
     echo '<br/>';
     $this->Exported();
 }
Ejemplo n.º 15
0
 function admin_uploaded()
 {
     $file_cmd = common::GetCommand('file_cmd');
     if (!empty($file_cmd) || isset($_REQUEST['show']) && $_REQUEST['show'] == 'inline') {
         $this->do_admin_uploaded($file_cmd);
     } else {
         $this->elFinder();
     }
 }
Ejemplo n.º 16
0
 /**
  * Display form for selecting classes
  *
  */
 function ClassesForm()
 {
     global $dataDir, $langmessage, $addonPathCode, $addonRelativeCode, $page;
     echo '<h2 class="hmargin">Manage Classes</h2>';
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'LoadDefault':
             $classes = self::Defaults();
             break;
         case 'LoadBootstrap':
             $classes = self::Bootstrap();
             break;
         default:
             $classes = self::GetClasses();
             break;
     }
     $classes[] = array('names' => '', 'desc' => '');
     $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="' . common::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>';
 }
Ejemplo n.º 17
0
 public function RunScript()
 {
     global $langmessage;
     $cmd = common::GetCommand();
     if (!$this->SetVars()) {
         return;
     }
     $this->GetFile();
     //allow addons to effect page actions and how a page is displayed
     $cmd_after = gpPlugin::Filter('PageRunScript', array($cmd));
     if ($cmd !== $cmd_after) {
         $cmd = $cmd_after;
         if ($cmd === 'return') {
             return;
         }
     }
     //admin actions
     if ($this->permission_menu) {
         switch ($cmd) {
             case 'renameit':
                 if ($this->RenameFile()) {
                     return;
                 }
                 break;
         }
     }
     //file editing actions
     if ($this->permission_edit) {
         switch ($cmd) {
             /* gallery/image editing */
             case 'gallery_folder':
             case 'gallery_images':
                 $this->GalleryImages();
                 return;
             case 'new_dir':
                 $this->contentBuffer = gp_edit::NewDirForm();
                 return;
                 /* inline editing */
             /* inline editing */
             case 'save':
             case 'save_inline':
             case 'preview':
             case 'inlineedit':
             case 'include_dialog':
                 $this->SectionEdit($cmd);
                 return;
             case 'image_editor':
                 gp_edit::ImageEditor();
                 return;
             case 'NewNestedSection':
                 $this->NewNestedSection($_REQUEST);
                 return;
         }
     }
     $this->RunCommands($cmd);
 }
Ejemplo n.º 18
0
 function SimpleSearch()
 {
     global $page, $langmessage, $addonPathData;
     $this->config_file = $addonPathData . '/search_config.php';
     $this->GetConfig();
     if (common::LoggedIn()) {
         $page->admin_links[] = array('Special_Search', 'Configuration', 'cmd=config');
         $cmd = common::GetCommand();
         switch ($cmd) {
             case 'save_config':
                 if ($this->SaveConfig()) {
                     break;
                 }
                 return;
             case 'config':
                 $this->Config($this->search_config);
                 return;
         }
     }
     $query =& $_GET['q'];
     echo '<div class="search_results">';
     echo '<form action="' . common::GetUrl('Special_Search') . '" method="get">';
     echo '<h2>';
     echo gpOutput::GetAddonText('Search');
     echo ' &nbsp; ';
     echo '<input name="q" type="text" class="text" value="' . htmlspecialchars($query) . '"/>';
     echo '<input type="hidden" name="src" value="gadget" /> ';
     $html = '<input type="submit" name="" class="submit" value="%s" />';
     echo gpOutput::GetAddonText('Search', $html);
     echo '</h2>';
     echo '</form>';
     if (!empty($query)) {
         $query = strtolower($query);
         preg_match_all("/\\S+/", $query, $words);
         $words = array_unique($words[0]);
         $pattern = '#(';
         $bar = '';
         foreach ($words as $word) {
             $pattern .= $bar . preg_quote($word, '#');
             $bar = '|';
         }
         $pattern .= ')#Si';
         $this->SearchPages($pattern);
         $this->SearchBlog($pattern);
     }
     if (count($this->files) > 0) {
         foreach ($this->files as $result) {
             echo $result;
         }
     } else {
         echo '<p>';
         echo gpOutput::GetAddonText('Sorry, there weren\'t any results for your search. ');
         echo '</p>';
     }
     echo '</div>';
 }
Ejemplo n.º 19
0
 function __construct()
 {
     $this->galleries = special_galleries::GetData();
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'newdrag':
             $this->NewDrag();
             return;
     }
     $this->EditGalleries();
 }
Ejemplo n.º 20
0
 function EasyComments_Admin()
 {
     $this->Init();
     $this->GetIndex();
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'easy_admin_rm':
         default:
             $this->ShowAdmin($cmd);
             break;
     }
 }
Ejemplo n.º 21
0
 function EasyComments_Config()
 {
     $this->Init();
     //$this->GetIndex();
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'save_config':
             $this->SaveConfig();
         default:
             $this->ShowConfig();
             break;
     }
 }
Ejemplo n.º 22
0
 function RunScript()
 {
     global $gp_index, $langmessage, $page;
     $scriptinfo = special_display::GetScriptInfo($this->requested);
     if ($scriptinfo === false) {
         switch ($this->requested) {
             case 'Special_ExtraJS':
                 $this->ExtraJS();
                 //dies
         }
         $this->Error_404($this->title);
         return;
     }
     $this->gp_index = $gp_index[$this->requested];
     $this->label = common::GetLabel($this->requested);
     $this->TitleInfo = $scriptinfo;
     $menu_permissions = false;
     if (common::LoggedIn()) {
         $menu_permissions = admin_tools::HasPermission('Admin_Menu');
         if ($menu_permissions) {
             $page->admin_links[] = common::Link($this->title, $langmessage['rename/details'], 'cmd=renameform', ' name="gpajax" ');
             $page->admin_links[] = common::Link('Admin_Menu', $langmessage['current_layout'], 'cmd=layout&from=page&index=' . urlencode($this->gp_index), ' title="' . $langmessage['current_layout'] . '" name="gpabox"');
         }
         if (admin_tools::HasPermission('Admin_User')) {
             $page->admin_links[] = common::Link('Admin_Users', $langmessage['permissions'], 'cmd=file_permissions&index=' . urlencode($this->gp_index), ' title="' . $langmessage['permissions'] . '" name="gpabox" ');
         }
     }
     //allow addons to affect page actions and how a page is displayed
     $cmd = common::GetCommand();
     $cmd_after = gpPlugin::Filter('PageRunScript', array($cmd));
     if ($cmd !== $cmd_after) {
         $cmd = $cmd_after;
         if ($cmd === 'return') {
             return;
         }
     }
     if ($menu_permissions) {
         switch ($cmd) {
             // rename & details
             case 'renameform':
                 $this->RenameForm();
                 return;
             case 'renameit':
                 if ($this->RenameFile()) {
                     return;
                 }
                 break;
         }
     }
     $this->contentBuffer = special_display::ExecInfo($scriptinfo);
 }
Ejemplo n.º 23
0
 function __construct()
 {
     global $page, $langmessage;
     $page->css_admin[] = '/include/css/addons.css';
     //$page->head_js[] = '/include/js/admin_ckeditor.js';
     $this->Init();
     // subpage
     $this->subpages = array('' => $langmessage['configuration'], 'Plugins' => $langmessage['Manage Plugins'], 'Example' => 'Example', 'Current' => $langmessage['Current Configuration']);
     if (strpos($page->requested, '/')) {
         $parts = explode('/', $page->requested);
         if (array_key_exists($parts[1], $this->subpages)) {
             $this->current_subpage = $parts[1];
         }
     }
     // commands
     $cmd = common::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 'Plugins':
             $this->PluginForm();
             break;
         case 'Current':
             $this->DisplayCurrent();
             break;
         case 'Example':
             $this->Example();
             break;
         default:
             $this->CustomConfigForm();
             break;
     }
     echo '<br/><p>';
     echo '<a href="http://ckeditor.com" target="_blank">CKEditor</a> is gpEasy\'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>';
 }
Ejemplo n.º 24
0
 function HighlighterSettings()
 {
     $this->config = gpPlugin::GetConfig();
     $this->config += array('theme' => 'default');
     $this->themes = array('default' => 'Default', 'django' => 'Django', 'eclipse' => 'Eclipse', 'emacs' => 'Emacs', 'fadetogrey' => 'Fade to Grey', 'midnight' => 'Midnight', 'rdark' => 'RDark', 'none' => '[None]');
     $this->themes = gpPlugin::Filter('syntaxhighlighter_themes', array($this->themes));
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'save':
             $this->Save();
             break;
     }
     $this->ShowForm();
 }
Ejemplo n.º 25
0
 function __construct()
 {
     global $page, $addonFolderName;
     parent::__construct();
     $this->dir = SimpleBlogCommon::$data_dir . '/comments';
     $this->GetCache();
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'delete_comment':
             $this->DeleteComment();
             break;
     }
     $this->ShowRecent();
 }
Ejemplo n.º 26
0
 function RunScript()
 {
     global $gp_index, $langmessage, $page;
     $scriptinfo = special_display::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 = common::GetCommand();
     $cmd_after = gpPlugin::Filter('PageRunScript', array($cmd));
     if ($cmd !== $cmd_after) {
         $cmd = $cmd_after;
         if ($cmd === 'return') {
             return;
         }
     }
     if (common::LoggedIn()) {
         $menu_permissions = admin_tools::HasPermission('Admin_Menu');
         if ($menu_permissions) {
             switch ($cmd) {
                 // rename & details
                 case 'renameform':
                     $this->RenameForm();
                     return;
                 case 'renameit':
                     if ($this->RenameFile()) {
                         return;
                     }
                     break;
                 case 'ToggleVisibility':
                     $this->ToggleVisibility();
                     break;
             }
         }
         $this->AdminLinks();
     }
     $this->contentBuffer = special_display::ExecInfo($scriptinfo);
 }
Ejemplo n.º 27
0
 function __construct()
 {
     global $langmessage, $dataDir;
     $this->folder = $dataDir . '/data/_extra';
     $this->Getdata();
     $cmd = common::GetCommand();
     $show = true;
     switch ($cmd) {
         case 'delete':
             $this->DeleteArea();
             break;
         case 'new_section':
             $this->NewSection();
             break;
         case 'view':
             $this->PreviewText();
             $show = false;
             break;
         case 'edit':
             if ($this->EditExtra()) {
                 $show = false;
             }
             break;
         case 'rawcontent':
             $this->RawContent();
             break;
             /* gallery editing */
         /* gallery editing */
         case 'gallery_folder':
         case 'gallery_images':
             $this->GalleryImages();
             return;
         case 'new_dir':
             gp_edit::NewDirForm();
             return;
             /* inline editing */
         /* inline editing */
         case 'save':
         case 'save_inline':
         case 'inlineedit':
         case 'include_dialog':
         case 'preview':
             $this->SectionEdit($cmd);
             return;
     }
     if ($show) {
         $this->ShowExtras();
     }
 }
Ejemplo n.º 28
0
 function AdminProtect()
 {
     global $gp_menu;
     $this->PageProtect();
     echo '<h2>';
     echo common::Link('Admin_Protect', 'Protected Pages');
     echo '</h2>';
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'savecontent':
             $this->SaveContent();
         case 'editcontent':
             $this->EditContent();
             return;
     }
     echo '<p>';
     echo '<b>' . common::Link('Admin_Protect', 'Protected Content', 'cmd=editcontent') . '</b> ';
     echo 'Edit the content users will see if they navigate to a protected page and aren\'t logged in.';
     echo '</p>';
     if (!count($this->config['pages'])) {
         echo '<p>There aren\'t any protected pages.</p>';
         return;
     }
     echo '<table class="bordered">';
     echo '<tr><th>Pages</th><th>Child Pages</th></tr>';
     foreach ($this->config['pages'] as $page_index => $bool) {
         $title = common::IndexToTitle($page_index);
         //may be deleted
         if (!$title) {
             continue;
         }
         echo '<tr>';
         echo '<td>';
         echo common::Link_Page($title);
         echo '</td>';
         echo '<td>';
         $affected = common::Descendants($page_index, $gp_menu);
         $titles = array();
         foreach ($affected as $temp_index) {
             $title = common::IndexToTitle($temp_index);
             $titles[] = common::Link_Page($title);
         }
         echo implode(', ', $titles);
         echo '</td>';
         echo '</tr>';
     }
     echo '</table>';
 }
Ejemplo n.º 29
0
 function special_galleries()
 {
     $this->galleries = special_galleries::GetData();
     if (common::LoggedIn()) {
         $cmd = common::GetCommand();
         switch ($cmd) {
             case 'edit':
                 $this->EditGalleries();
                 return;
             case 'newdrag':
                 $this->NewDrag();
                 return;
         }
     }
     $this->GenerateOutput();
 }
Ejemplo n.º 30
0
 function __construct()
 {
     global $page, $addonFolderName;
     $this->Init();
     $this->dir = $this->addonPathData . '/comments';
     $page->css_user[] = '/data/_addoncode/' . $addonFolderName . '/admin.css';
     //gpPlugin::css('admin.css'); //gpeasy 4.0+
     $this->GetCache();
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'delete_comment':
             $this->DeleteComment();
             break;
     }
     $this->ShowRecent();
 }