Exemplo n.º 1
0
 function SaveContent()
 {
     global $langmessage;
     $content =& $_POST['content'];
     gpFiles::cleanText($content);
     $this->config['content'] = $content;
     if ($this->SaveConfig()) {
         message($langmessage['SAVED']);
     } else {
         message($langmessage['OOPS']);
     }
 }
Exemplo n.º 2
0
 function Save404()
 {
     $text =& $_POST['gpcontent'];
     gpFiles::cleanText($text);
     $this->error_data['404_TEXT'] = $text;
     if ($this->SaveData_Message()) {
         return true;
     }
     $this->Edit404($text);
     return false;
 }
Exemplo n.º 3
0
 /**
  * Save an inline edit
  *
  */
 function SaveInline()
 {
     global $page, $langmessage;
     $page->ajaxReplace = array();
     $post_index = $_REQUEST['id'];
     $posts = $this->GetPostFile($post_index, $post_file);
     if ($posts === false) {
         message($langmessage['OOPS']);
         return;
     }
     $content =& $_POST['gpcontent'];
     gpFiles::cleanText($content);
     $posts[$post_index]['content'] = $content;
     //save to data file
     if (!gpFiles::SaveArray($post_file, 'posts', $posts)) {
         message($langmessage['OOPS']);
         return false;
     }
     $page->ajaxReplace[] = array('ck_saved', '', '');
     message($langmessage['SAVED']);
     return true;
 }
Exemplo n.º 4
0
 /**
  * Save Gallery Content
  *
  */
 static function SectionFromPost_Gallery(&$section)
 {
     if (empty($_POST['images'])) {
         $section['content'] = '<ul class="gp_gallery"><li class="gp_to_remove"></li></ul>';
         return;
     }
     ob_start();
     echo '<ul class="gp_gallery">';
     foreach ($_POST['images'] as $i => $image) {
         $thumb_path = common::ThumbnailPath($image);
         $caption = $_POST['captions'][$i];
         gpFiles::cleanText($caption);
         echo '<li>';
         echo '<a class="gallery_gallery" title="' . htmlspecialchars($caption) . '" data-arg="gallery_gallery" href="' . $image . '" data-cmd="gallery">';
         echo '<img src="' . $thumb_path . '" alt="" /></a>';
         echo '<div class="caption">';
         echo $caption;
         echo '</div>';
         echo '</li>';
     }
     echo '</ul>';
     $section['content'] = ob_get_clean();
     $section['images'] = $_POST['images'];
     $section['captions'] = $_POST['captions'];
 }
Exemplo n.º 5
0
 /**
  * Used by slideshow addons
  * @deprecated 3.6rc4
  *
  */
 function SaveSection_Text($section)
 {
     global $config;
     $content =& $_POST['gpcontent'];
     gpFiles::cleanText($content);
     $this->file_sections[$section]['content'] = $content;
     if ($config['resize_images']) {
         gp_edit::ResizeImages($this->file_sections[$section]['content'], $this->file_sections[$section]['resized_imgs']);
     }
     return true;
 }
Exemplo n.º 6
0
 /**
  * Save a post
  *
  */
 static function SavePost($post_index, $post)
 {
     global $gpAdmin;
     gpFiles::cleanText($post['content']);
     $post['username'] = $gpAdmin['username'];
     $post_file = SimpleBlogCommon::PostFilePath($post_index);
     if (!gpFiles::SaveArray($post_file, 'post', $post)) {
         message($langmessage['OOPS'] . ' (Post not saved)');
         return false;
     }
     //remove from old data file
     $posts = SimpleBlogCommon::GetPostFile($post_index, $post_file);
     if (isset($posts[$post_index])) {
         unset($posts[$post_index]);
         gpFiles::SaveArray($post_file, 'posts', $posts);
     }
     return true;
 }
Exemplo n.º 7
0
 /**
  * Save the posted content for an extra content area
  *
  */
 function SaveExtra()
 {
     global $langmessage, $page;
     //for ajax responses
     $page->ajaxReplace = array();
     if (empty($_REQUEST['file'])) {
         message($langmessage['OOPS']);
         return false;
     }
     $title = gp_edit::CleanTitle($_REQUEST['file']);
     $file = $this->folder . '/' . $title . '.php';
     $text =& $_POST['gpcontent'];
     gpFiles::cleanText($text);
     if (!gpFiles::SaveFile($file, $text)) {
         message($langmessage['OOPS']);
         $this->EditExtra();
         return false;
     }
     $page->ajaxReplace[] = array('ck_saved', '', '');
     message($langmessage['SAVED']);
     $this->areas[$title] = $title;
     return true;
 }