本文整理汇总了PHP中gpFiles::cleanText方法的典型用法代码示例。如果您正苦于以下问题:PHP gpFiles::cleanText方法的具体用法?PHP gpFiles::cleanText怎么用?PHP gpFiles::cleanText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpFiles
的用法示例。
在下文中一共展示了gpFiles::cleanText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SaveContent
function SaveContent()
{
global $langmessage;
$content =& $_POST['content'];
gpFiles::cleanText($content);
$this->config['content'] = $content;
if ($this->SaveConfig()) {
message($langmessage['SAVED']);
} else {
message($langmessage['OOPS']);
}
}
示例2: Save404
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;
}
示例3: SaveInline
/**
* 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;
}
示例4: SectionFromPost_Gallery
/**
* 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'];
}
示例5: SaveSection_Text
/**
* 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;
}
示例6: SavePost
/**
* 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;
}
示例7: SaveExtra
/**
* 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;
}