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


PHP Publication::GetPublications方法代码示例

本文整理汇总了PHP中Publication::GetPublications方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::GetPublications方法的具体用法?PHP Publication::GetPublications怎么用?PHP Publication::GetPublications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Publication的用法示例。


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

示例1: 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

示例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);
            }
        }
    }
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:40,代码来源:pub_common.php

示例3: smarty_function_set_publication

/**
 * Campsite set_publication function plugin
 *
 * Type:     function
 * Name:     set_publication
 * Purpose:
 *
 * @param array
 *     $p_params[name] The Name of the publication to be set
 *     $p_params[identifier] The Identifier of the publication to be set
 * @param object
 *     $p_smarty The Smarty object
 */
function smarty_function_set_publication($p_params, &$p_smarty)
{
    // gets the context variable
    $campsite = $p_smarty->getTemplateVars('gimme');
    if (isset($p_params['identifier'])) {
        $attrName = 'identifier';
        $attrValue = $p_params['identifier'];
        $publicationId = intval($p_params['identifier']);
    } elseif (isset($p_params['name'])) {
        $attrName = 'name';
        $attrValue = $p_params['name'];
        $publications = Publication::GetPublications($p_params['name']);
        if (!empty($publications)) {
            $publicationId = $publications[0]->getPublicationId();
        } else {
            $campsite->publication->trigger_invalid_value_error($attrName, $attrValue, $p_smarty);
            return false;
        }
    } else {
        $property = array_shift(array_keys($p_params));
        CampTemplate::singleton()->trigger_error("invalid parameter '{$property}' in set_publication");
        return false;
    }
    if ($campsite->publication->defined && $campsite->publication->identifier == $publicationId) {
        return;
    }
    $publicationObj = new MetaPublication($publicationId);
    if ($publicationObj->defined) {
        $campsite->publication = $publicationObj;
    } else {
        $campsite->publication->trigger_invalid_value_error($attrName, $attrValue, $p_smarty);
    }
}
开发者ID:nidzix,项目名称:Newscoop,代码行数:46,代码来源:function.set_publication.php

示例4: Issue

        $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
        if (!$issueObj->exists()) {
            camp_html_display_error($translator->trans('Issue does not exist.'));
            exit;
        }
        if ($f_section_number > 0) {
            $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number);
            if (!$sectionObj->exists()) {
                camp_html_display_error($translator->trans('Section does not exist.'));
                exit;
            }
        }
    }
}
// Get all the publications
$allPublications = Publication::GetPublications();
// Automatically select the publication if there is only one.
if (count($allPublications) == 1) {
    $tmpPublication = camp_array_peek($allPublications);
    $f_destination_publication_id = $tmpPublication->getPublicationId();
}
// Get the most recent issues.
$allIssues = array();
if ($f_destination_publication_id > 0) {
    $allIssues = Issue::GetIssues($f_destination_publication_id, null, null, null, null, false, array("LIMIT" => 300, "ORDER BY" => array("Number" => "DESC"), 'GROUP BY' => 'Number'), true);
    // Automatically select the issue if there is only one.
    if (count($allIssues) == 1) {
        $tmpIssue = camp_array_peek($allIssues);
        $f_destination_issue_number = $tmpIssue->getIssueNumber();
    }
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:duplicate.php

示例5: array

require_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/camp_html.php";
require_once $GLOBALS['g_campsiteDir'] . '/classes/Language.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Publication.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Issue.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Section.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Article.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
$maxSelectLength = 60;
$languageId = Input::get('IdLanguage', 'int', 0, true);
$publicationId = Input::get('IdPublication', 'int', 0, true);
$sectionId = Input::get('NrSection', 'int', 0, true);
$issueId = Input::get('NrIssue', 'int', 0, true);
$articleId = Input::get('NrArticle', 'int', 0, true);
$target = Input::get('targetlist', 'string', '', true);
$languages = Language::GetLanguages(null, null, null, array(), array(), true);
$publications = Publication::GetPublications();
if ($languageId != 0 && $publicationId != 0) {
    $issues = Issue::GetIssues($publicationId, $languageId, null, null, null, false, null, true);
}
if ($languageId != 0 && $publicationId != 0 && $issueId != 0) {
    $sections = Section::GetSections($publicationId, $issueId, $languageId, null, null, null, true);
}
if ($languageId != 0 && $publicationId != 0 && $issueId != 0 && $sectionId != 0) {
    $articles = Article::GetArticles($publicationId, $issueId, $sectionId, $languageId);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>{#campsiteinternallink_dlg.title}</title>
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:link.php

示例6: camp_load_translation_strings

<?php

require_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/pub/pub_common.php";
require_once $GLOBALS['g_campsiteDir'] . "/classes/SimplePager.php";
camp_load_translation_strings("api");
// Check permissions
$PubOffs = camp_session_get('PubOffs', 0);
if ($PubOffs < 0) {
    $PubOffs = 0;
}
$ItemsPerPage = 15;
$sqlOptions = array("LIMIT" => array("START" => $PubOffs, "MAX_ROWS" => $ItemsPerPage), "ORDER BY" => array("Name" => "ASC"));
$publications = Publication::GetPublications(null, null, $sqlOptions);
$numPublications = Publication::GetNumPublications();
$pager = new SimplePager($numPublications, $ItemsPerPage, "PubOffs", "index.php?");
camp_html_content_top(getGS('Publication List'), null);
if ($g_user->hasPermission("ManagePub") && SaaS::singleton()->hasPermission("AddPub")) {
    ?>
<P>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons">
<TR>
	<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"];
    ?>
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:index.php

示例7: require_once

<?PHP
require_once($GLOBALS['g_campsiteDir']."/classes/Publication.php");
require_once($GLOBALS['g_campsiteDir']."/classes/Issue.php");
require_once($GLOBALS['g_campsiteDir']."/classes/Section.php");

global $Campsite;

/**
 * $Campsite["issues"] in indexed by publication ID.
 * $Campsite["sections"] is indexed by publication ID, issue number, and issue language.
 */
$Campsite["publications"] = Publication::GetPublications();
$Campsite["issues"] = array();
$Campsite["sections"] = array();
foreach ($Campsite["publications"] as $publication) {
	$Campsite["issues"][$publication->getPublicationId()] =
		Issue::GetIssues($publication->getPublicationId(), null, null, null, $publication->getLanguageId(),
			false, array('ORDER BY'=>array('Number'=>'DESC'), 'LIMIT' => '5'), true);
	foreach ($Campsite["issues"][$publication->getPublicationId()] as $issue) {
		$Campsite["sections"][$issue->getPublicationId()][$issue->getIssueNumber()][$issue->getLanguageId()] =
			Section::GetSections($issue->getPublicationId(),
				$issue->getIssueNumber(), $issue->getLanguageId(),
				null, null, array('ORDER BY'=>array('Number'=>'ASC'), 'LIMIT' => '10'), true);
	}
}

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


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