本文整理汇总了PHP中Publication::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::getName方法的具体用法?PHP Publication::getName怎么用?PHP Publication::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Publication
的用法示例。
在下文中一共展示了Publication::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Publication
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");
?>
示例2: 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);
}
}
}
}
示例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);
}
}
}
}
示例4: takeAction
/**
* Performs the action; returns true on success, false on error.
*
* @param $p_context - the current context object
* @return bool
*/
public function takeAction(CampContext &$p_context)
{
$p_context->default_url->reset_parameter('f_'.$this->m_name);
$p_context->url->reset_parameter('f_'.$this->m_name);
if (!is_null($this->m_error)) {
return false;
}
// Check that the article exists.
$articleMetaObj = $p_context->default_article;
if (!$articleMetaObj->defined) {
$this->m_error = new PEAR_Error('The article was not selected. You must view an article in order to post comments.',
ACTION_PREVIEW_COMMENT_ERR_NO_ARTICLE);
return false;
}
if (!$articleMetaObj->comments_enabled || $articleMetaObj->comments_locked) {
$this->m_error = new PEAR_Error('Comments are not enabled for this publication/article.',
ACTION_PREVIEW_COMMENT_ERR_NOT_ENABLED);
return false;
}
// Get the publication.
$publicationObj = new Publication($articleMetaObj->publication->identifier);
$forum = new Phorum_forum($publicationObj->getForumId());
if (!$forum->exists()) {
$forum->create();
$forum->setName($publicationObj->getName());
$publicationObj->setForumId($forum->getForumId());
}
$forumId = $forum->getForumId();
$user = $p_context->user;
if ($user->defined) {
$this->m_properties['reader_email'] = $user->email;
} else {
if ($forum->getPublicPermissions() & (PHORUM_USER_ALLOW_NEW_TOPIC | PHORUM_USER_ALLOW_REPLY)) {
if (!isset($this->m_properties['reader_email'])) {
$this->m_error = new PEAR_Error('EMail field is empty. You must fill in your EMail address.',
ACTION_PREVIEW_COMMENT_ERR_NO_EMAIL);
return false;
}
} else {
$this->m_error = new PEAR_Error('You must be a registered user in order to submit a comment. Please subscribe or log in if you already have a subscription.',
ACTION_PREVIEW_COMMENT_ERR_NO_PUBLIC);
return false;
}
}
// Check if the reader was banned from posting comments.
if (Phorum_user::IsBanned($userRealName, $userEmail)) {
$this->m_error = new PEAR_Error('You are banned from submitting comments.',
ACTION_PREVIEW_COMMENT_ERR_BANNED);
return false;
}
$this->m_error = ACTION_OK;
return true;
}
示例5: create
/**
* @param array $p_values
* @return boolean
*/
public function create($p_values = null)
{
$success = parent::create($p_values);
$publicationObj = new Publication($this->m_data['IdPublication']);
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('The default subscription time for ($1 "$2":$3) has been added.', getGS("Publication"), $publicationObj->getName(), $this->m_data['CountryCode']);
Log::Message($logtext, null, 4);
return $success;
} // fn create
示例6: htmlspecialchars
</A>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="1" WIDTH="100%" class="current_location_table">
<TR>
<TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php
echo $translator->trans("Publication");
?>
:</TD>
<TD VALIGN="TOP" class="current_location_content"><?php
echo htmlspecialchars($publicationObj->getName());
?>
</TD>
<TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php
echo $translator->trans("Issue");
?>
:</TD>
<TD VALIGN="TOP" class="current_location_content"><?php
echo $issueObj->getIssueNumber();
?>
. <?php
echo htmlspecialchars($issueObj->getName());
?>
(<?php
echo htmlspecialchars($issueLanguage->getName());
示例7: p
<A HREF="/<?php echo $ADMIN; ?>/issues/?Pub=<?php p($Pub); ?>" class="breadcrumb" ><?php putGS("Issues"); ?></A>
</TD>
<td class="breadcrumb_separator"> </td>
<TD>
<A HREF="/<?php echo $ADMIN; ?>/pub/" class="breadcrumb"><?php putGS("Publications"); ?></A>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="1" WIDTH="100%" class="current_location_table">
<TR>
<TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Publication"); ?>:</TD>
<TD VALIGN="TOP" class="current_location_content"><?php echo htmlspecialchars($publicationObj->getName()); ?></TD>
<TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Issue"); ?>:</TD>
<TD VALIGN="TOP" class="current_location_content"><?php echo $issueObj->getIssueNumber(); ?>. <?php echo htmlspecialchars($issueObj->getName()); ?> (<?php echo htmlspecialchars($issueLanguage->getName()); ?>)</TD>
<TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Section"); ?>:</TD>
<TD VALIGN="TOP" class="current_location_content"><?php echo $sectionObj->getSectionNumber(); ?>. <?php echo htmlspecialchars($sectionObj->getName()); ?></TD>
<TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Article"); ?>:</TD>
<TD VALIGN="TOP" class="current_location_content"><?php echo htmlspecialchars($articleObj->getTitle()); ?> (<?php echo htmlspecialchars($articleLanguage->getName()); ?>)</TD>
</TR>
</TABLE>
<table width="100%" border="0">
<tr>
<td style="padding:20px;" align="center">
示例8: putGS
</TR>
<tr class="table_list_header">
<TD ALIGN="LEFT" VALIGN="TOP" nowrap><B><?php putGS("trial subscription"); ?></B></TD>
<TD ALIGN="LEFT" VALIGN="TOP" nowrap><B><?php putGS("paid subscription"); ?></B></TD>
</tr>
<?php
$color = 0;
foreach ($defaultTimes as $time) {
$country = new Country($time->getCountryCode(), $Language);
?>
<TR <?php if ($color) { $color=0; ?>class="list_row_even"<?php } else { $color=1; ?>class="list_row_odd"<?php } ?>>
<TD>
<A HREF="/<?php p($ADMIN); ?>/pub/editdeftime.php?Pub=<?php p($Pub); ?>&CountryCode=<?php p($time->getCountryCode()); ?>&Language=<?php p($Language); ?>"><?php p(htmlspecialchars($country->getName())); ?> (<?php p(htmlspecialchars($country->getCode())); ?>)</A>
</TD>
<TD ALIGN="center">
<?php p(htmlspecialchars($time->getTrialTime())); ?>
</TD>
<TD ALIGN="center">
<?php p(htmlspecialchars($time->getPaidTime())); ?>
</TD>
<TD ALIGN="CENTER">
<A HREF="/<?php p($ADMIN); ?>/pub/do_deldeftime.php?Pub=<?php p($Pub); ?>&CountryCode=<?php p($time->getCountryCode()); ?>&Language=<?php p($Language); ?>&<?php echo SecurityToken::URLParameter(); ?>" onclick="return confirm('<?php putGS('Are you sure you want to delete the subscription settings for $1?', """.htmlspecialchars($publicationObj->getName()).':'.htmlspecialchars($time->getCountryCode())."""); ?>');"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/delete.png" BORDER="0" ALT="<?php putGS('Delete'); ?>" TITLE="<?php putGS('Delete'); ?>" ></A>
</TD>
</TR>
<?php
}
?> <TR><TD COLSPAN="2" NOWRAP>
</TABLE>
<?php camp_html_copyright_notice(); ?>
示例9: p
p($ADMIN);
?>
/pub/do_deldeftime.php?Pub=<?php
p($Pub);
?>
&CountryCode=<?php
p($time->getCountryCode());
?>
&Language=<?php
p($Language);
?>
&<?php
echo SecurityToken::URLParameter();
?>
" onclick="return confirm('<?php
putGS('Are you sure you want to delete the subscription settings for $1?', """ . htmlspecialchars($publicationObj->getName()) . ':' . htmlspecialchars($time->getCountryCode()) . """);
?>
');"><IMG SRC="<?php
echo $Campsite["ADMIN_IMAGE_BASE_URL"];
?>
/delete.png" BORDER="0" ALT="<?php
putGS('Delete');
?>
" TITLE="<?php
putGS('Delete');
?>
" ></A>
</TD>
</TR>
<?php
}
示例10: Publication
$correct = ($f_dest_publication_id > 0) && ($f_dest_issue_number > 0) && ($f_dest_section_number > 0);
$created = false;
if ($correct) {
$dstSectionObj = $srcSectionObj->copy($f_dest_publication_id, $f_dest_issue_number,
$f_language_id, $f_dest_section_number);
if (($radioButton == "new_section") && ($f_dest_section_name != "")) {
$dstSectionObj->setName($f_dest_section_name);
}
$dstPublicationObj = new Publication($f_dest_publication_id);
$dstIssueObj = new Issue($f_dest_publication_id, $f_language_id, $f_dest_issue_number);
$created = true;
// Record the event in the log.
$logtext = getGS('Section "$1" has been duplicated to $2. "$3" of "$4"',
$dstSectionObj->getName(), $f_dest_issue_number, $dstIssueObj->getName(),
$dstPublicationObj->getName());
Log::Message($logtext, $g_user->getUserId(), 154);
camp_html_goto_page("/$ADMIN/sections/duplicate_complete.php?"
."f_src_publication_id=$f_src_publication_id"
."&f_src_issue_number=$f_src_issue_number"
."&f_src_section_number=$f_src_section_number"
."&f_language_id=$f_language_id"
."&f_dest_publication_id=$f_dest_publication_id"
."&f_dest_issue_number=$f_dest_issue_number"
."&f_dest_section_number=$f_dest_section_number");
} else {
$topArray = array('Pub' => $srcPublicationObj, 'Issue' => $srcIssueObj, 'Section' => $srcSectionObj);
camp_html_content_top(getGS('Duplicating section'), $topArray);
}
?>
示例11: getGS
}
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
$changed = true;
$changed &= $issueObj->setName($f_issue_name);
if ($issueObj->getWorkflowStatus() == 'Y') {
$changed &= $issueObj->setPublicationDate($f_publication_date);
}
$changed &= $issueObj->setIssueTemplateId($f_issue_template_id);
$changed &= $issueObj->setSectionTemplateId($f_section_template_id);
$changed &= $issueObj->setArticleTemplateId($f_article_template_id);
if ($changed) {
$logtext = getGS('Issue "$1" ($2) updated in publication "$3"', $f_issue_name, $f_issue_number, $publicationObj->getName());
Log::Message($logtext, $g_user->getUserId(), 11);
} else {
$errMsg = getGS("Could not save the changes to the issue.");
camp_html_add_msg($errMsg);
exit;
}
// The tricky part - language ID and URL name must be unique.
$conflictingIssues = Issue::GetIssues($f_publication_id, $f_new_language_id, null, $f_url_name, null, false, null, true);
$conflictingIssue = array_pop($conflictingIssues);
// If it conflicts with another issue
if ($errorMsg = camp_is_issue_conflicting($f_publication_id, $f_issue_number, $f_new_language_id, $f_url_name, true)) {
camp_html_add_msg($errorMsg);
camp_html_goto_page($backLink);
} else {
示例12: camp_html_breadcrumbs
$f_subscription_id = Input::Get('f_subscription_id', 'int', 0);
$publicationObj = new Publication($f_publication_id);
$languageObj = new Language($publicationObj->getDefaultLanguageId());
$subscription = new Subscription($f_subscription_id);
$manageUser = new User($f_user_id);
$sections = SubscriptionSection::GetSubscriptionSections($f_subscription_id);
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Subscribers"), "/$ADMIN/users/?uType=Subscribers");
$crumbs[] = array(getGS("Account") . " '".$manageUser->getUserName()."'",
"/$ADMIN/users/edit.php?User=$f_user_id&uType=Subscribers");
$crumbs[] = array(getGS("Subscriptions"), "/$ADMIN/users/subscriptions/?f_user_id=$f_user_id");
$crumbs[] = array(getGS("Subscribed sections").": ".$publicationObj->getName(), "");
echo camp_html_breadcrumbs($crumbs);
$subscription_num_sections = SubscriptionSection::GetNumSections($f_subscription_id);
$publication_num_sections = Section::GetNumUniqueSections($f_publication_id);
$subscription_num_sections_nolang = SubscriptionSection::GetNumSections($f_subscription_id, null, 0);
$publication_num_sections_nolang = Section::GetNumUniqueSections($f_publication_id, false);
?>
<P>
<table cellpadding="0" cellspacing="0" class="action_buttons">
<tr>
<td valign=top>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1">
<?php
示例13: putGS
putGS("Add new publication");
?>
</B></A>
</TD>
<?php
}
if ($g_user->hasPermission("DeletePub")) {
?>
<TD style="padding-left: 10px;"><A HREF="/<?php
echo $ADMIN;
?>
/pub/do_del.php?Pub=<?php
p($f_publication_id);
?>
" onclick="return confirm('<?php
putGS('Are you sure you want to delete the publication $1?', htmlspecialchars($publicationObj->getName()));
?>
');"><IMG SRC="<?php
echo $Campsite["ADMIN_IMAGE_BASE_URL"];
?>
/delete.png" BORDER="0"></A></TD>
<TD><A HREF="/<?php
echo $ADMIN;
?>
/pub/do_del.php?Pub=<?php
p($f_publication_id);
?>
&<?php
echo SecurityToken::URLParameter();
?>
" onclick="return confirm('<?php
示例14: p
<TD ><A HREF="/<?php echo $ADMIN; ?>/issues/?Pub=<?php p($f_publication_id); ?>"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/go_to.png" BORDER="0"></A></TD>
</TR>
</TABLE>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-bottom: 1em;">
<TR>
<?php if ($g_user->hasPermission("ManagePub")) { ?> <P>
<TD>
<A HREF="/<?php echo $ADMIN; ?>/pub/add.php?Back=<?php p(urlencode($_SERVER['REQUEST_URI'])); ?>"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/add.png" BORDER="0"></A>
</TD>
<TD>
<A HREF="/<?php echo $ADMIN; ?>/pub/add.php?Back=<?php p(urlencode($_SERVER['REQUEST_URI'])); ?>"><B><?php putGS("Add new publication"); ?></B></A>
</TD>
<?php } ?>
<?php
if ($g_user->hasPermission("DeletePub")) {
?>
<TD style="padding-left: 10px;"><A HREF="do_del.php?Pub=<?php p($f_publication_id); ?>" onclick="return confirm('<?php putGS('Are you sure you want to delete the publication $1?', htmlspecialchars($publicationObj->getName())); ?>');"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/delete.png" BORDER="0"></A></TD>
<TD><A HREF="do_del.php?Pub=<?php p($f_publication_id); ?>&<?php echo SecurityToken::URLParameter(); ?>" onclick="return confirm('<?php putGS('Are you sure you want to delete the publication $1?', htmlspecialchars($publicationObj->getName())); ?>');"><B><?php putGS("Delete"); ?></B></A></TD>
<?php } ?>
</TR>
</TABLE>
<?php camp_html_display_msgs(0); ?>
<FORM METHOD="POST" ACTION="do_edit.php" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
<?php include("pub_form.php"); ?>
</FORM>
<P>
<?php camp_html_copyright_notice(); ?>
示例15: Publication
$cPaidTime = Input::Get('cPaidTime', 'int', 0);
if (!Input::IsValid()) {
camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
exit;
}
$backLink = "/$ADMIN/pub/countryadd.php?Pub=$cPub&Language=$Language";
$publicationObj = new Publication($cPub);
if (empty($cCountryCode)) {
camp_html_add_msg(getGS('You must select a country.'));
camp_html_goto_page($backLink);
}
$values = array('TrialTime' => $cTrialTime,
'PaidTime' => $cPaidTime);
$defaultTime = new SubscriptionDefaultTime($cCountryCode, $cPub);
if ($defaultTime->exists()) {
$defaultTime->update($values);
} else {
$created = $defaultTime->create($values);
if (!$created) {
camp_html_add_msg(getGS("The subscription settings for '$1' could not be added.", $publicationObj->getName().':'.$cCountryCode));
camp_html_goto_page($backLink);
}
}
camp_html_add_msg(getGS("Country subscription settings updated."), "ok");
camp_html_goto_page("/$ADMIN/pub/deftime.php?Pub=$cPub&Language=$Language");
?>