当前位置: 首页>>代码示例>>PHP>>正文


PHP camp_html_add_msg函数代码示例

本文整理汇总了PHP中camp_html_add_msg函数的典型用法代码示例。如果您正苦于以下问题:PHP camp_html_add_msg函数的具体用法?PHP camp_html_add_msg怎么用?PHP camp_html_add_msg使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了camp_html_add_msg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: require_once

require_once($GLOBALS['g_campsiteDir']."/classes/Country.php");

if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}

// Check permissions
if (!$g_user->hasPermission('ManagePub')) {
	camp_html_display_error(getGS("You do not have the right to manage publications."));
	exit;
}

$Pub = Input::Get('Pub', 'int', 0);
$Language = Input::Get('Language', 'int', 1, true);
$CountryCode = Input::Get('CountryCode');

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
	exit;
}

$publicationObj = new Publication($Pub);
$defaultTime = new SubscriptionDefaultTime($CountryCode, $Pub);
$defaultTime->delete();

$logtext = getGS('Subscription default time for "$1":$2 deleted', $publicationObj->getName(), $CountryCode);
Log::Message($logtext, $g_user->getUserId(), 5);
camp_html_add_msg(getGS("Country subscription settings deleted."), "ok");
camp_html_goto_page("/$ADMIN/pub/deftime.php?Pub=$Pub&Language=$Language");
?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:do_deldeftime.php

示例2: setMessage

/**
 * Set message
 * @param string $message
 * @return void
 */
function setMessage($message, $isError = FALSE)
{
    if (empty($_REQUEST['archive'])) { // fancybox
        echo '<script type="text/javascript">';
        echo 'try {';

        if (!$isError) {
            echo 'parent.$.fancybox.reload = true;';
            echo 'parent.$.fancybox.message = "', $message, '";';
        } else {
            echo 'parent.$.fancybox.error = "', $message, '";';
        }

        echo 'parent.$.fancybox.close();';
        echo '} catch (e) {}';
        echo '</script>';
        exit;
    }

    if ($isError) {
	    camp_html_display_error($message, null, true);
        exit;
    }

    camp_html_add_msg($message);
}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:do_add.php

示例3: camp_is_alias_conflicting

/**
 * Check if the alias given is already in use.  If so, a user error message
 * is created.
 *
 * @param mixed $p_alias
 * 		Can be a string or an int.
 * @return void
 */
function camp_is_alias_conflicting($p_alias)
{
	global $ADMIN;

	if (!is_numeric($p_alias)) {
		// The alias given is a name, which means it doesnt exist yet.
		// Check if the name conflicts with any existing alias names.
		$aliases = Alias::GetAliases(null, null, $p_alias);
		$alias = array_pop($aliases);
		if ($alias) {
			$pubId = $alias->getPublicationId();
			$pubObj = new Publication($pubId);
			$pubLink = "<A HREF=\"/$ADMIN/pub/edit.php?Pub=$pubId\">". $pubObj->getName() ."</A>";
			$msg = getGS("The publication alias you specified conflicts with publication '$1'.", $pubLink);
			camp_html_add_msg($msg);
		}
	} else {
		// The alias given is a number, which means it already exists.
		// Check if the alias ID is already in use by another publication.
		$aliases = Alias::GetAliases($p_alias);
		$alias = array_pop($aliases);
		if ($alias) {
			$pubs = Publication::GetPublications(null, $alias->getId());
			if (count($pubs) > 0) {
				$pubObj = array_pop($pubs);
				$pubLink = "<A HREF=\"/$ADMIN/pub/edit.php?Pub=".$pubObj->getPublicationId().'">'. $pubObj->getName() ."</A>";
				$msg = getGS("The publication alias you specified conflicts with publication '$1'.", $pubLink);
				camp_html_add_msg($msg);
			}
		}
	}
}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:40,代码来源:pub_common.php

示例4: camp_is_alias_conflicting

/**
 * Check if the alias given is already in use.  If so, a user error message
 * is created.
 *
 * @param mixed $p_alias
 * 		Can be a string or an int.
 * @return void
 */
function camp_is_alias_conflicting($p_alias)
{
    global $ADMIN;
    $translator = \Zend_Registry::get('container')->getService('translator');
    if (!is_numeric($p_alias)) {
        // The alias given is a name, which means it doesnt exist yet.
        // Check if the name conflicts with any existing alias names.
        $aliases = Alias::GetAliases(null, null, $p_alias);
        $alias = array_pop($aliases);
        if ($alias) {
            $pubId = $alias->getPublicationId();
            $pubObj = new Publication($pubId);
            $pubLink = "<A HREF=\"/{$ADMIN}/pub/edit.php?Pub={$pubId}\">" . $pubObj->getName() . "</A>";
            $msg = $translator->trans("The publication alias you specified conflicts with publication '\$1'.", array('$1' => $pubLink), 'pub');
            camp_html_add_msg($msg);
        }
    } else {
        // The alias given is a number, which means it already exists.
        // Check if the alias ID is already in use by another publication.
        $aliases = Alias::GetAliases($p_alias);
        $alias = array_pop($aliases);
        if ($alias) {
            $pubs = Publication::GetPublications(null, $alias->getId());
            if (count($pubs) > 0) {
                $pubObj = array_pop($pubs);
                $pubLink = "<A HREF=\"/{$ADMIN}/pub/edit.php?Pub=" . $pubObj->getPublicationId() . '">' . $pubObj->getName() . "</A>";
                $msg = $translator->trans("The publication alias you specified conflicts with publication '\$1'.", array('$1' => $pubLink), 'pub');
                camp_html_add_msg($msg);
            }
        }
    }
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:40,代码来源:pub_common.php

示例5: StoreImageDerivates

    public static function StoreImageDerivates($p_object_type, $p_object_id, $p_image)
    {
        if ($p_image['error'] !== 0 || self::TestImage($p_image) !== 0) {
            return false;   
        }

        foreach (BlogImageHelper::GetImagePaths($p_object_type, $p_object_id) as $dim => $path) {
            list ($width, $height) = explode('x', $dim);
            
            $d_width = $width * 2;
            $d_height = $height * 2;

            if (!file_exists(dirname($path))) {
                $mkdir = '';
                foreach (explode('/', dirname($path)) as $k => $dir) {
                    $mkdir .= '/'.$dir;
                    @mkdir($mkdir, 0775);
                }
            }

            $cmd = "convert -resize {$d_width}x -resize 'x{$d_height}<' -resize 50% -gravity center  -crop {$width}x{$height}+0+0 +repage {$p_image['tmp_name']} $path";
            system($cmd, $return_value);
            
            $all_right = $return_value || $all_right;
            
            if ($return_value ==  0) {
                $success[] = $width.'x'.$height;       
            } else {
                $failed[] = $width.'x'.$height;   
            }
        }
        
        if (function_exists('camp_html_add_msg')) {
            if (is_array($success)) {
                camp_html_add_msg(getGS('Created image derivate(s): $1', implode(', ', $success)), 'ok');
            }
            if (is_array($failed)) {
                camp_html_add_msg(getGS('Failed to create image derivate(s): $1', implode(', ', $failed)), 'error');    
            }
        }

        return $all_right;
    }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:43,代码来源:BlogImageHelper.php

示例6: urlencode

    exit;
}

$f_path = Input::Get('f_path', 'string', '');
$f_charset = Input::Get('f_charset', 'string', '');


$baseUpload = $Campsite['TEMPLATE_DIRECTORY'] . $f_path;
$backLink = "/$ADMIN/templates/upload_templ.php?Path=" . urlencode($f_path);

$nrOfFiles = isset($_POST['uploader_count']) ? $_POST['uploader_count'] : 0;
for ($i = 0; $i < $nrOfFiles; $i++) {
    $tmpnameIdx = 'uploader_' . $i . '_tmpname';
    $nameIdx = 'uploader_' . $i . '_name';
    $statusIdx = 'uploader_' . $i . '_status';
    if ($_POST[$statusIdx] == 'done') {
        $tmpFilePath = CS_TMP_TPL_DIR . DIR_SEP . $_POST[$tmpnameIdx];
        $newFilePath = $baseUpload . DIR_SEP . $_POST[$nameIdx];
        $result = Template::ProcessFile($tmpFilePath, $newFilePath, $f_charset);
    }
}

if ($result) {
    camp_html_add_msg(getGS('"$1" files uploaded.', $nrOfFiles), "ok");
    camp_html_goto_page("/$ADMIN/templates/?Path=" . urlencode($f_path));
} else {
    camp_html_add_msg($f_path . DIR_SEP . basename($newFilePath));
    camp_html_goto_page($backLink);
}

?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:do_upload_templ.php

示例7: array

    if ($uploadFileSpecified) {
        $attributes = array();
        $image = Image::OnImageUpload($_FILES['file'], $attributes);
        if (PEAR::isError($image)) {
            camp_html_add_msg($image->getMessage());
        } else {
            $author->setImage($image->getImageId());
        }
    }
    $aliases = Input::Get("alias", "array");
    if (!empty($aliases)) {
        $author->setAliases($aliases);
    }
    camp_html_add_msg($translator->trans("Author saved.", array(), 'users'), "ok");
} elseif ($del_id_alias < 1 && $id > -1 && !$can_save) {
    camp_html_add_msg($translator->trans("Please fill at least first name and last name.", array(), 'users'));
}
if (!$id || $id == -1) {
    $author = new Author(1);
    if ($id == -1) {
        $id = 0;
    }
}
$controller->view->headTitle($translator->trans('Authors') . ' - Newscoop Admin', 'SET');
$crumbs = array();
$crumbs[] = array($translator->trans("Configure"), "");
$crumbs[] = array($translator->trans("Authors"), "");
$breadcrumbs = camp_html_breadcrumbs($crumbs);
echo $breadcrumbs;
?>
开发者ID:kartoffelkage,项目名称:Newscoop,代码行数:30,代码来源:authors.php

示例8: move_uploaded_file

                try {
                    move_uploaded_file($file['tmp_name'], $move_dest);
                    camp_html_add_msg($translator->trans('The file $1 has been uploaded successfully.', array('$1' => $file['name']), 'home'), 'ok');
                } catch (Exception $exc) {
                    $move_failed = true;
                    camp_html_add_msg($translator->trans('The file $1 could not be moved. Check you have enough of disk space.', array('$1' => $file['name']), 'home'));
                }
                // try to remove the (partially) moved file if the move was not successful
                if ($move_failed) {
                    try {
                        unlink($move_dest);
                    } catch (Exception $exc) {
                    }
                }
            } else {
                camp_html_add_msg($translator->trans("You have tried to upload an invalid backup file.", array(), 'home'));
            }
        }
        $files = getBackupList();
        break;
}
// show breadcrumbs
$crumbs = array();
$crumbs[] = array($translator->trans("Actions"), "");
$crumbs[] = array($translator->trans("Backup/Restore", array(), 'home'), "");
$breadcrumbs = camp_html_breadcrumbs($crumbs);
echo $breadcrumbs;
// view template
?>
<script type="text/javascript" src="<?php 
echo $Campsite['WEBSITE_URL'];
开发者ID:alvsgithub,项目名称:Newscoop,代码行数:31,代码来源:backup.php

示例9: Image

$imageObj = new Image($f_image_id);

if (!is_null($f_image_description) && $g_user->hasPermission('ChangeImage')) {
	$attributes = array();
	$attributes['Description'] = $f_image_description;
	$attributes['Photographer'] = $f_image_photographer;
	$attributes['Place'] = $f_image_place;
	$attributes['Date'] = $f_image_date;
	$imageObj->update($attributes);
}

if ($g_user->hasPermission('AttachImageToArticle')) {
	if (is_numeric($f_image_template_id) && ($f_image_template_id > 0)) {
		$articleImageObj = new ArticleImage($f_article_number, $f_image_id);
		$updated = $articleImageObj->setTemplateId($f_image_template_id);
		if ($updated == false) {
			camp_html_add_msg(getGS("Image number '$1' already exists", $f_image_template_id));
			camp_html_goto_page($backLink);
		}
	}
}

camp_html_add_msg(getGS("Image '$1' updated.", $imageObj->getDescription()), "ok");

?>

<script type="text/javascript">
	window.location.href='<?php echo "/$ADMIN/articles/edit.php?f_language_id=$f_language_id&f_article_number=$f_article_number"; ?>'
</script>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:29,代码来源:do_edit.php

示例10: camp_html_display_error

if (!$publicationObj->exists()) {
    camp_html_display_error($translator->trans("Publication does not exist."));
    exit;
}
$created = false;
$errorMsgs = array();
if (empty($f_issue_number) || !is_numeric($f_issue_number) || $f_issue_number <= 0) {
    camp_html_add_msg($translator->trans('You must fill in the $1 field.', array('$1' => '<B>' . $translator->trans('Number') . '</B>')));
}
if (camp_html_has_msgs()) {
    camp_html_goto_page($backLink);
}
// check if the issue number already exists
$lastIssue = Issue::GetLastCreatedIssue($f_publication_id);
$existingIssues = Issue::GetIssues($f_publication_id, null, $f_issue_number, null, null, false, null, true);
if (count($existingIssues) > 0) {
    $conflictingIssue = array_pop($existingIssues);
    $conflictingIssueLink = "/{$ADMIN}/issues/edit.php?" . "Pub={$f_publication_id}" . "&Issue=" . $conflictingIssue->getIssueNumber() . "&Language=" . $conflictingIssue->getLanguageId();
    $errMsg = $translator->trans('The number must be unique for each issue in this publication of the same language.', array(), 'issues') . "<br>" . $translator->trans('The values you are trying to set conflict with issue $1$2. $3 ($4)$5.', array('$1' => "<a href='{$conflictingIssueLink}' class='error_message' style='color:#E30000;'>", '$2' => $conflictingIssue->getIssueNumber(), '$3' => $conflictingIssue->getName(), '$4' => $conflictingIssue->getLanguageName(), '$5' => '</a>'), 'issues');
    camp_html_add_msg($errMsg);
    camp_html_goto_page($backLink);
}
$issueCopies = $lastIssue->copy(null, $f_issue_number);
if (!is_null($issueCopies)) {
    $issueCopy = $issueCopies[0];
    camp_html_add_msg($translator->trans("Issue created.", array(), 'issues'), "ok");
    camp_html_goto_page("/{$ADMIN}/issues/edit.php?Pub={$f_publication_id}&Issue=" . $issueCopy->getIssueNumber() . "&Language=" . $issueCopy->getLanguageId());
} else {
    camp_html_add_msg($translator->trans("The issue could not be added.", array(), 'issues'));
    camp_html_goto_page($backLink);
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:do_add_prev.php

示例11: getGS

    if ($f_publish_action == "P" || $f_publish_action == "U") {
        $articlePublishObj->setPublishAction($f_publish_action);
    }
    if ($f_front_page_action == "S" || $f_front_page_action == "R") {
        $articlePublishObj->setFrontPageAction($f_front_page_action);
    }
    if ($f_section_page_action == "S" || $f_section_page_action == "R") {
        $articlePublishObj->setSectionPageAction($f_section_page_action);
    }
    Log::ArticleMessage($tmpArticle, getGS('Scheduled action added'), $g_user->getUserId(), 37);
}
if ($f_mode == "multi") {
    $args = $_REQUEST;
    unset($args["f_article_code"]);
    $argsStr = camp_implode_keys_and_values($args, "=", "&");
    camp_html_add_msg(getGS("Scheduled action added."), "ok");
    camp_html_goto_page("/{$ADMIN}/articles/index.php?" . $argsStr);
} else {
    ?>
	<script type="text/javascript">
    try {
        parent.$.fancybox.reload = true;
        parent.$.fancybox.message = '<?php 
    putGS('Actions updated.');
    ?>
';
        parent.$.fancybox.close();
    } catch (e) {
    }
	</script>
	<?php 
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:autopublish_do_add.php

示例12: camp_html_display_error

require_once $GLOBALS['g_campsiteDir'] . '/classes/User.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Log.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
$translator = \Zend_Registry::get('container')->getService('translator');
if (!SecurityToken::isValid()) {
    camp_html_display_error($translator->trans('Invalid security token!'));
    exit;
}
$f_language_id = Input::Get('f_language_id', 'int', 0);
$f_language_selected = Input::Get('f_language_selected', 'int', 0);
$f_article_number = Input::Get('f_article_number', 'int', 0);
$f_image_id = Input::Get('f_image_id', 'int', 0);
$f_image_template_id = Input::Get('f_image_template_id', 'int', 0);
// Check input
if (!Input::IsValid()) {
    camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString())), null, true);
    exit;
}
// This file can only be accessed if the user has the right to change articles
// or the user created this article and it hasnt been published yet.
if (!$g_user->hasPermission('AttachImageToArticle')) {
    camp_html_display_error($translator->trans("You do not have the right to attach images to articles.", array(), 'article_images'), null, true);
    exit;
}
$articleObj = new Article($f_language_selected, $f_article_number);
$imageObj = new Image($f_image_id);
$articleImage = new ArticleImage($f_article_number, $f_image_id, $f_image_template_id);
$articleImage->delete();
Zend_Registry::get('container')->getService('image.rendition')->unsetArticleImageRenditions($f_article_number, $f_image_id);
camp_html_add_msg($translator->trans('The image has been removed from the article.', array(), 'article_images'), "ok");
camp_html_goto_page(camp_html_article_url($articleObj, $f_language_id, 'edit.php'));
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:do_unlink.php

示例13: array

}
if (!$g_user->hasPermission('AddImage')) {
	camp_html_goto_page("/$ADMIN/logout.php");
}
$attributes = array();
$attributes['Description'] = $f_image_description;
$attributes['Photographer'] = $f_image_photographer;
$attributes['Place'] = $f_image_place;
$attributes['Date'] = $f_image_date;
if (!empty($f_image_url)) {
	if (camp_is_valid_url($f_image_url)) {
		$image = Image::OnAddRemoteImage($f_image_url, $attributes, $g_user->getUserId());
	} else {
		camp_html_add_msg(getGS("The URL you entered is invalid: '$1'", htmlspecialchars($f_image_url)));
		camp_html_goto_page("/$ADMIN/media-archive/add.php");
	}
} elseif (!empty($_FILES['f_image_file'])) {
	$image = Image::OnImageUpload($_FILES['f_image_file'], $attributes, $g_user->getUserId());
} else {
	camp_html_add_msg(getGS("You must select an image file to upload."));
	camp_html_goto_page("/$ADMIN/media-archive/add.php");
}

// Check if image was added successfully
if (PEAR::isError($image)) {
	camp_html_add_msg($image->getMessage());
	camp_html_goto_page("/$ADMIN/media-archive/add.php");
}

?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:do_add.php

示例14: camp_html_display_error

if (!$g_user->hasPermission('plugin_blog_admin')) {
    camp_html_display_error(getGS('You do not have the right to manage blogs.'));
    exit;
}

$f_blog_id = Input::Get('f_blog_id', 'int');
$f_entry_id = Input::Get('f_entry_id', 'int');

if (!$f_entry_id) {
    $user_id = $g_user->getUserId();   
}

$BlogEntry = new BlogEntry($f_entry_id, $f_blog_id);

if ($BlogEntry->store($is_admin, $user_id)) {
    camp_html_add_msg(getGS('Post saved.'), 'ok');
    ?>
    <script language="javascript">
        window.opener.location.reload();
        window.close();
    </script>
    <?php
    exit();
}

?>
<head>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<META HTTP-EQUIV="Expires" CONTENT="now">
	<link rel="stylesheet" type="text/css" href="<?php echo $Campsite['WEBSITE_URL']; ?>/admin-style/admin_stylesheet.css" />
	<title><?php $BlogEntry->exists() ? putGS('Edit post') : putGS('Add new post'); ?></title>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:entry_form.php

示例15: FileTextSearch

					$replaceObj = new FileTextSearch();
					$replaceObj->setExtensions(array('tpl','css'));
					$replaceObj->setSearchKey($searchKey);
					$replaceObj->setReplacementKey($replacementKey);
					$replaceObj->findReplace($Campsite['TEMPLATE_DIRECTORY']);
					Template::UpdateOnChange($template->getName(),
								 $f_destination_folder
								 . '/'
								 . basename($template->getName()));
				}
			}
			// Clear compiled templates
			require_once($GLOBALS['g_campsiteDir']."/template_engine/classes/CampTemplate.php");
			CampTemplate::singleton()->clear_compiled_tpl();

			camp_html_add_msg(getGS("Template(s) moved."), "ok");
			camp_html_goto_page($url);
		}
	}
} // END perform the action

$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Templates"), "/$ADMIN/templates/");
$crumbs[] = array(getGS("Move templates"), "");
echo camp_html_breadcrumbs($crumbs);

include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");

camp_html_display_msgs();
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:move.php


注:本文中的camp_html_add_msg函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。