GetArticleTypes() public static method

Returns an array of strings.
public static GetArticleTypes ( boolean $p_includeHidden = false ) : array
$p_includeHidden boolean
return array
 /**
  * Get options
  *
  * @return array
  */
 public function getOptions()
 {
     $types = \ArticleType::GetArticleTypes($p_includeHidden = false);
     $options = array();
     foreach ($types as $type) {
         $options[$type] = $type;
     }
     return $options;
 }
 public function beforeRender()
 {
     $articlesParams = array();
     foreach ((array) \ArticleType::GetArticleTypes(true) as $one_art_type_name) {
         $one_art_type = new \ArticleType($one_art_type_name);
         if ($one_art_type->getFilterStatus()) {
             $articlesParams[] = new ComparisonOperation('type', new Operator('not', 'string'), $one_art_type->getTypeName());
         }
     }
     $articlesOrders = array(array('field' => 'bylastupdate', 'dir' => 'desc'));
     $this->items = Article::GetList($articlesParams, $articlesOrders, 0, self::LIMIT, $count = 0);
 }
Example #3
0
    if (count($allIssues) == 1) {
        $singleIssue = camp_array_peek($allIssues);
        $f_destination_issue_number = $singleIssue->getIssueNumber();
        $f_article_language = $singleIssue->getLanguageId();
    }
}
$allSections = array();
if ($f_destination_issue_number > 0) {
    $selectedIssue = new Issue($f_destination_publication_id, $f_article_language, $f_destination_issue_number);
    $allSections = Section::GetSections($f_destination_publication_id, $f_destination_issue_number, $f_article_language, null, null, array("ORDER BY" => array("Name" => "ASC")), true);
    if (count($allSections) == 1) {
        $singleSection = camp_array_peek($allSections);
        $f_destination_section_number = $singleSection->getSectionNumber();
    }
}
$allArticleTypes = ArticleType::GetArticleTypes();
$allLanguages = Language::GetLanguages(null, null, null, array(), array(), true);
$crumbs = array();
$crumbs[] = array($translator->trans("Actions"), "");
$crumbs[] = array($translator->trans("Add new article"), "");
echo camp_html_breadcrumbs($crumbs);
?>

<?php 
if (sizeof($allArticleTypes) == 0) {
    ?>
<p>
<table border="0" cellspacing="0" cellpadding="0" class="box_table">
<tr>
	<td align="center">
	<font color="red">
Example #4
0
<?php

camp_load_translation_strings("article_types");
require_once $GLOBALS['g_campsiteDir'] . '/classes/ArticleType.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
// Check permissions
if (!$g_user->hasPermission('ManageArticleTypes')) {
    camp_html_display_error(getGS("You do not have the right to merge article types."));
    exit;
}
$articleTypes = ArticleType::GetArticleTypes();
$f_src = trim(Input::get('f_src'));
$f_dest = trim(Input::get('f_dest'));
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Article Types"), "/{$ADMIN}/article_types/");
$crumbs[] = array(getGS("Merge article type"), "");
echo camp_html_breadcrumbs($crumbs);
?>
<P>
<FORM NAME="dialog" METHOD="POST" ACTION="/<?php 
echo $ADMIN;
?>
/article_types/merge2.php">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
<TR>
	<TD COLSPAN="2">
		<b><?php 
putGS("Merge Article Types: Step \$1 of \$2", "1", "3");
?>
</b>
Example #5
0
<?php
camp_load_translation_strings("article_types");
require_once($GLOBALS['g_campsiteDir'].'/classes/ArticleType.php');
require_once($GLOBALS['g_campsiteDir'].'/classes/Translation.php');

$articleTypes = ArticleType::GetArticleTypes(true);
// 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);

$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Article Types"), "");

echo camp_html_breadcrumbs($crumbs);
include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");
?>
<script>
var type_ids = new Array;
var allShown = 0;
</script>


<?php
if (count($articleTypes))
{
	$i = 0;
	foreach ($articleTypes as $articleType)
	{ ?>
Example #6
0
	private static function ReadArticleTypes()
	{
		if (is_null(self::$s_articleTypes)) {
            require_once($GLOBALS['g_campsiteDir'].'/classes/ArticleType.php');
			$articleTypes = ArticleType::GetArticleTypes(true);
			self::$s_articleTypes = array();
			foreach ($articleTypes as $articleType) {
				self::$s_articleTypes[strtolower($articleType)] = $articleType;
			}
		}
	}
Example #7
0
            if (empty($_REQUEST['language'])) {
                $_REQUEST['language'] = $sectionFiltersArray[2];
            }
            $_REQUEST['section'] = $sectionFiltersArray[3];
        }
    }
}
foreach ($filters as $name => $opts) {
    if (isset($_REQUEST[$name]) && (!empty($_REQUEST[$name]) || $_REQUEST[$name] === 0)) {
        $field = !empty($fields[$name]) ? $fields[$name] : $name;
        $articlesParams[] = new ComparisonOperation($field, new Operator($opts[0], $opts[1]), $_REQUEST[$name]);
    }
}
if (empty($_REQUEST['showtype']) || $_REQUEST['showtype'] != 'with_filtered') {
    // limit articles of filtered types by default
    foreach ((array) \ArticleType::GetArticleTypes(true) as $one_art_type_name) {
        $one_art_type = new \ArticleType($one_art_type_name);
        if ($one_art_type->getFilterStatus()) {
            $articlesParams[] = new ComparisonOperation('type', new Operator('not', 'string'), $one_art_type->getTypeName());
        }
    }
}
// search
if (isset($_REQUEST['sSearch']) && strlen($_REQUEST['sSearch']) > 0) {
    $search_phrase = $_REQUEST['sSearch'];
    //$articlesParams[] = new ComparisonOperation('search_phrase', new Operator('is', 'integer'), $search_phrase);
    $articlesParams[] = new ComparisonOperation('search_phrase', new Operator('like', 'string'), "__match_all." . $search_phrase);
}
// sorting
$cols = $list->getColumnKeys();
$sortOptions = array('Number' => 'bynumber', 'Order' => 'bysectionorder', 'Name' => 'byname', 'Comments' => 'bycomments', 'Reads' => 'bypopularity', 'CreateDate' => 'bycreationdate', 'PublishDate' => 'bypublishdate');