本文整理汇总了PHP中camp_html_display_error函数的典型用法代码示例。如果您正苦于以下问题:PHP camp_html_display_error函数的具体用法?PHP camp_html_display_error怎么用?PHP camp_html_display_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了camp_html_display_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: verify_user_type
function verify_user_type()
{
global $uType;
if (!isset($uType)) {
read_user_common_parameters();
}
if ($uType != "Staff" && $uType != "Subscribers") {
camp_html_display_error(getGS('Invalid value of user type parameter'));
exit(0);
}
return $uType;
}
示例3: verify_user_type
function verify_user_type()
{
global $uType;
$translator = \Zend_Registry::get('container')->getService('translator');
if (!isset($uType)) {
read_user_common_parameters();
}
if ($uType != "Staff" && $uType != "Subscribers") {
camp_html_display_error($translator->trans('Invalid value of user type parameter', array(), 'users'));
exit(0);
}
return $uType;
}
示例4: require_once
<?php
require_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/issues/issue_common.php");
// Check permissions
if (!$g_user->hasPermission('ManageIssue')) {
camp_html_display_error(getGS('You do not have the right to add issues.'));
exit;
}
$Pub = Input::Get('Pub', 'int');
if (!Input::IsValid()) {
camp_html_display_error(getGS('Invalid Input: $1', Input::GetErrorString()));
exit;
}
$publicationObj = new Publication($Pub);
$allLanguages = Language::GetLanguages(null, null, null, array(), array(), true);
$newIssueId = Issue::GetUnusedIssueId($Pub);
$lastCreatedIssue = Issue::GetLastCreatedIssue($Pub);
include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");
camp_html_content_top(getGS('Copy previous issue'), array('Pub' => $publicationObj), true, true, array(getGS("Issues") => "/$ADMIN/issues/?Pub=$Pub"));
if (is_null($lastCreatedIssue)) { ?>
<BLOCKQUOTE>
<LI><?php putGS('No previous issue.'); ?></LI>
</BLOCKQUOTE>
<?php
} else {
camp_html_display_msgs();
示例5: Issue
if (!Input::IsValid()) {
camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
exit;
}
$issueObj = new Issue($Pub, $Language, $Issue);
$publicationObj = new Publication($Pub);
$sectionObj = new Section($Pub, $Issue, $Language, $Section);
if (!$publicationObj->exists()) {
camp_html_display_error(getGS('Publication does not exist.'));
exit;
}
if (!$issueObj->exists()) {
camp_html_display_error(getGS('No such issue.'));
exit;
}
$correct = true;
$modified = false;
$errors = array();
if ($cName == "") {
camp_html_add_msg(getGS('You must fill in the $1 field.','"'.getGS('Name').'"'));
}
if ($cShortName == "") {
camp_html_add_msg(getGS('You must fill in the $1 field.','"'.getGS('URL Name').'"'));
}
$isValidShortName = camp_is_valid_url_name($cShortName);
示例6: camp_load_translation_strings
<?php
camp_load_translation_strings("article_type_fields");
camp_load_translation_strings("api");
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/ArticleType.php';
require_once $GLOBALS['g_campsiteDir'] . "/classes/Topic.php";
// Check permissions
if (!$g_user->hasPermission('ManageArticleTypes')) {
camp_html_display_error(getGS("You do not have the right to reassign a field type."));
exit;
}
$articleTypeName = Input::Get('f_article_type');
$articleTypeFieldName = Input::Get('f_field_name');
$articleField = new ArticleTypeField($articleTypeName, $articleTypeFieldName);
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Article Types"), "/{$ADMIN}/article_types/");
$crumbs[] = array($articleTypeName, '');
$crumbs[] = array(getGS("Article type fields"), "/{$ADMIN}/article_types/fields/?f_article_type=" . urlencode($articleTypeName));
$crumbs[] = array(getGS("Reassign a field type"), "");
echo camp_html_breadcrumbs($crumbs);
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
$lang = camp_session_get('LoginLanguageId', 1);
$languageObj = new Language($lang);
// Verify the merge rules
$options = array();
$convertibleFromTypes = $articleField->getConvertibleToTypes();
foreach ($convertibleFromTypes as $type) {
$options[$type] = ArticleTypeField::VerboseTypeName($type, $languageObj->getLanguageId());
}
示例7: require_once
<?php
/**
* @package Campsite
*/
require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/templates/template_common.php");
if (!SecurityToken::isValid()) {
camp_html_display_error(getGS('Invalid security token!'));
exit;
}
if (!$g_user->hasPermission('ManageTempl')) {
camp_html_display_error(getGS("You do not have the right to modify templates."));
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];
示例8: camp_html_display_error
<?php
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/ArticleType.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Translation.php';
$translator = \Zend_Registry::get('container')->getService('translator');
$request = \Zend_Registry::get('container')->get('request');
$locale = $request->getLocale();
if (!Saas::singleton()->hasPermission('ManageArticleTypes')) {
camp_html_display_error($translator->trans("You do not have the right to manage article types.", array(), 'article_type_fields'));
exit;
}
$articleTypeName = Input::Get('f_article_type');
// return value is sorted by language
$allLanguages = Language::GetLanguages(null, null, null, array(), array(), true);
$lang = Language::GetLanguageByCode($locale);
$languageObj = new Language($lang->getLanguageId());
$articleType = new ArticleType($articleTypeName);
$fields = $articleType->getUserDefinedColumns(null, true, true);
$crumbs = array();
$crumbs[] = array($translator->trans("Configure"), "");
$crumbs[] = array($translator->trans("Article Types"), "/{$ADMIN}/article_types/");
$crumbs[] = array($articleTypeName, "");
$crumbs[] = array($translator->trans("Article type fields", array(), 'article_type_fields'), "");
echo camp_html_breadcrumbs($crumbs);
$row_rank = 0;
if ($g_user->hasPermission("ManageArticleTypes")) {
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
?>
<script>
var field_ids = new Array;
示例9: camp_load_translation_strings
<?php
camp_load_translation_strings("plugin_debate");
// Check permissions
if (!$g_user->hasPermission('plugin_debate_admin')) {
camp_html_display_error(getGS('You do not have the right to manage debates.'));
exit;
}
$allLanguages = Language::GetLanguages();
$f_debate_nr = Input::Get('f_debate_nr', 'int');
$f_fk_language_id = Input::Get('f_fk_language_id', 'int');
$debate = new Debate($f_fk_language_id, $f_debate_nr);
if (!$debate->exists()) {
camp_html_display_error(getGS('Debate does not exists.'));
exit;
}
$title = $debate->getProperty('title');
$question = $debate->getProperty('question');
$date_begin = $debate->getProperty('date_begin');
$date_end = $debate->getProperty('date_end');
$fk_language_id = $debate->getProperty('fk_language_id');
$votes_per_user = $debate->getProperty('votes_per_user');
/*
$topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj,
'Section' => $sectionObj);
camp_html_content_top(getGS('Add new article'), $topArray, true, false, array(getGS("Articles") => "/$ADMIN/articles/?f_publication_id=$f_publication_id&f_issue_number=$f_issue_number&f_section_number=$f_section_number&f_language_id=$f_language_id"));
*/
?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;">
<TR>
<TD><A HREF="index.php"><IMG SRC="<?php
示例10: camp_html_display_error
<?php
$translator = \Zend_Registry::get('container')->getService('translator');
require_once CS_PATH_SITE . DIR_SEP . 'scripts' . DIR_SEP . 'file_processing.php';
// check permission
if (!$g_user->hasPermission('ManageBackup')) {
camp_html_display_error($translator->trans("You do not have the right to manage backups.", array(), 'home'));
exit;
}
// make backup list and define file name based on index
$files = getBackupList();
$fileIndex = Input::Get('index', 'integer', 0);
if (!empty($files[$fileIndex]['name'])) {
$file = CS_PATH_SITE . DIR_SEP . 'backup' . DIR_SEP . $files[$fileIndex]['name'];
} else {
$file = null;
}
// main controller
$action = Input::Get('action', 'string', null);
switch ($action) {
case 'backup':
set_time_limit(0);
ob_end_flush();
flush();
echo str_repeat(' ', 2048);
echo '<pre>';
$options = array('--default-dir', '--keep-session');
include CS_PATH_SITE . DIR_SEP . 'bin' . DIR_SEP . 'newscoop-backup';
echo '</pre><script type="text/javascript">window.opener.location.reload();</script>';
echo '<center><a href=# onclick="window.close()">' . $translator->trans('Close') . '</a></center>';
exit(0);
示例11: camp_html_display_error
$f_language_selected = Input::Get('f_language_selected', 'int', 0);
$f_article_number = Input::Get('f_article_number', 'int', 0);
$f_attachment_id = Input::Get('f_attachment_id', 'int', 0);
if (!Input::IsValid()) {
camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString())), $_SERVER['REQUEST_URI'], true);
exit;
}
if ($f_publication_id > 0) {
$publicationObj = new Publication($f_publication_id);
$issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
$sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number);
}
$articleObj = new Article($f_language_selected, $f_article_number);
$attachmentObj = new Attachment($f_attachment_id);
if (!$articleObj->exists()) {
camp_html_display_error($translator->trans("Article does not exist."), null, true);
exit;
}
$isDisabled = '';
$isReadOnly = '';
if (!$g_user->hasPermission('ChangeFile')) {
$isDisabled = 'disabled';
$isReadOnly = 'readonly';
$title = $translator->trans('File information', array(), 'article_files');
} else {
$title = $translator->trans('Change file information', array(), 'article_files');
}
// Add extra breadcrumb for image list.
if ($f_publication_id > 0) {
$extraCrumbs = array($translator->trans("Attachments", array(), 'article_files') => "");
$topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj, 'Article' => $articleObj);
示例12: camp_load_translation_strings
<?php
camp_load_translation_strings("article_type_fields");
camp_load_translation_strings("api");
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/ArticleType.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Translation.php';
if (!Saas::singleton()->hasPermission('ManageArticleTypes')) {
camp_html_display_error(getGS("You do not have the right to manage article types."));
exit;
}
$articleTypeName = Input::Get('f_article_type');
// return value is sorted by language
$allLanguages = Language::GetLanguages(null, null, null, array(), array(), true);
$lang = camp_session_get('LoginLanguageId', 1);
$languageObj = new Language($lang);
$articleType = new ArticleType($articleTypeName);
$fields = $articleType->getUserDefinedColumns(null, true, true);
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Article Types"), "/{$ADMIN}/article_types/");
$crumbs[] = array($articleTypeName, "");
$crumbs[] = array(getGS("Article type fields"), "");
echo camp_html_breadcrumbs($crumbs);
$row_rank = 0;
if ($g_user->hasPermission("ManageArticleTypes")) {
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
?>
<script>
var field_ids = new Array;
var allShown = 0;
示例13: trim
$f_image_photographer = trim(Input::Get('f_image_photographer', 'string', null, true));
$f_image_place = trim(Input::Get('f_image_place', 'string', null, true));
$f_image_date = Input::Get('f_image_date', 'string', null, true);
$backLink = "/$ADMIN/articles/images/edit.php?"
. "f_publication_id=" . $f_publication_id
. "&f_issue_number=" . $f_issue_number
. "&f_section_number=" . $f_section_number
. "&f_article_number=" . $f_article_number
. "&f_image_id=" . $f_image_id
. "&f_language_id=" . $f_language_id
. "&f_language_selected=" . $f_language_selected
. "&f_image_template_id=" . $f_orig_image_template_id;
if (!Input::IsValid()) {
camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), null, true);
exit;
}
$articleObj = new Article($f_language_selected, $f_article_number);
if (!$g_user->hasPermission('ChangeImage') && !$g_user->hasPermission('AttachImageToArticle')) {
camp_html_add_msg(getGS("You do not have the right to change image information."));
camp_html_goto_page(camp_html_article_url($articleObj, $f_language_id, 'edit.php'));
}
$imageObj = new Image($f_image_id);
if (!is_null($f_image_description) && $g_user->hasPermission('ChangeImage')) {
$attributes = array();
$attributes['Description'] = $f_image_description;
示例14: camp_html_display_error
<?php
require_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/issues/issue_common.php";
require_once $GLOBALS['g_campsiteDir'] . '/classes/Article.php';
$translator = \Zend_Registry::get('container')->getService('translator');
// Check permissions
if (!$g_user->hasPermission('DeleteIssue')) {
camp_html_display_error($translator->trans('You do not have the right to delete issues.', array(), 'issues'));
exit;
}
$f_publication_id = Input::Get('f_publication_id', 'int');
$f_issue_number = Input::Get('f_issue_number', 'int');
$f_language_id = Input::Get('f_language_id', 'int');
if (!Input::IsValid()) {
camp_html_display_error($translator->trans('Invalid Input: $1', array('$1' => Input::GetErrorString()), 'issues'));
exit;
}
$numArticles = count(Article::GetArticles($f_publication_id, $f_issue_number, null, $f_language_id));
$publicationObj = new Publication($f_publication_id);
$issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
camp_html_content_top($translator->trans('Delete issue', array(), 'issues'), array('Pub' => $publicationObj, 'Issue' => $issueObj));
?>
<P>
<FORM METHOD="POST" ACTION="/<?php
echo $ADMIN;
?>
/issues/do_del.php">
<?php
echo SecurityToken::FormParameter();
?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box">
示例15: camp_load_translation_strings
<?php
camp_load_translation_strings("article_type_fields");
camp_load_translation_strings("api");
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Log.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/ArticleType.php';
if (!SecurityToken::isValid()) {
camp_html_display_error(getGS('Invalid security token!'));
exit;
}
// Check permissions
if (!$g_user->hasPermission('ManageArticleTypes')) {
camp_html_display_error(getGS("You do not have the right to reassign article type fields."));
exit;
}
$articleTypeName = Input::Get('f_article_type');
$fieldName = trim(Input::Get('f_field_name'));
$fieldType = trim(Input::Get('f_article_field_type'));
$field = new ArticleTypeField($articleTypeName, $fieldName);
$correct = true;
$errorMsgs = array();
if (!$field->exists()) {
$errorMsgs[] = getGS('The field $1 does not exist.', '<B>' . urlencode($fieldName) . '</B>');
$correct = false;
}
if (array_search($fieldType, $field->getConvertibleToTypes()) === false) {
$errorMsgs[] = getGS('Can not convert the field $1 from $2 to type $3.', $fieldName, $field->getType(), $fieldType);
$correct = false;
}
if ($correct) {