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


PHP eZContentClassClassGroup::fetchClassList方法代码示例

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


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

示例1: getGroupedClasses

 public static function getGroupedClasses()
 {
     /** @var ContainerInterface $container */
     $container = ezpKernel::instance()->getServiceContainer();
     $params = $container->getParameter('kaliop_class_select');
     $classInclude = $classExclude = $groupInclude = $groupExclude = false;
     $cgparams = array();
     if (!empty($params['classes']['include'])) {
         $classInclude = true;
         $cgparams = $params['classes']['include'];
     } elseif (!empty($params['classes']['exclude'])) {
         $classExclude = true;
         $cgparams = $params['classes']['exclude'];
     } elseif (!empty($params['class_groups']['include'])) {
         $groupInclude = true;
         $cgparams = $params['class_groups']['include'];
     } elseif (!empty($params['class_groups']['exclude'])) {
         $groupExclude = true;
         $cgparams = $params['class_groups']['exclude'];
     }
     $groups = eZContentClassGroup::fetchList(false, true);
     $return = array();
     $count = 0;
     foreach ($groups as $group) {
         if ($groupInclude and (in_array($group->attribute('id'), $cgparams) or in_array($group->attribute('name'), $cgparams)) or !$groupInclude and $groupExclude and (!in_array($group->attribute('id'), $cgparams) or !in_array($group->attribute('name'), $cgparams)) or !$groupInclude and !$groupExclude) {
             $array = array('name' => $group->attribute('name'), 'classes' => array());
             $count++;
             $classes = eZContentClassClassGroup::fetchClassList(0, $group->attribute('id'), true);
             foreach ($classes as $class) {
                 if ($classInclude and (in_array($class->attribute('id'), $cgparams) or in_array($class->attribute('identifier'), $cgparams)) or !$classInclude and $classExclude and (!in_array($class->attribute('id'), $cgparams) or !in_array($class->attribute('identifier'), $cgparams)) or !$classInclude and !$classExclude) {
                     $array['classes'][] = array('identifier' => $class->attribute('identifier'), 'name' => $class->attribute('name'));
                     $count++;
                 }
             }
             $return[] = $array;
         }
     }
     return array('result' => array('groups' => $return, 'total' => $count));
 }
开发者ID:kaliop-uk,项目名称:ez-class-select-bundle,代码行数:39,代码来源:classselectfunctioncollection.php

示例2: fetchUserGroupClassNames

 static function fetchUserGroupClassNames()
 {
     // Get names of user classes
     $userClassNames = array();
     $userClasses = eZUser::fetchUserClassList(false, array('identifier'));
     foreach ($userClasses as $class) {
         $userClassNames[] = $class['identifier'];
     }
     // Get names of all allowed content-classes for the Users subtree
     $contentIni = eZINI::instance("content.ini");
     $userGroupClassNames = array();
     if ($contentIni->hasVariable('ClassGroupIDs', 'Users') and is_numeric($usersClassGroupID = $contentIni->variable('ClassGroupIDs', 'Users')) and count($usersClassList = eZContentClassClassGroup::fetchClassList(eZContentClass::VERSION_STATUS_DEFINED, $usersClassGroupID)) > 0) {
         foreach ($usersClassList as $userClass) {
             $userGroupClassNames[] = $userClass->attribute('identifier');
         }
     }
     // Get names of user-group classes
     $groupClassNames = array_diff($userGroupClassNames, $userClassNames);
     return $groupClassNames;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:20,代码来源:ezuser.php

示例3: array

 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version  2012.6
 * @package kernel
 */
$Module = $Params['Module'];
$http = eZHTTPTool::instance();
$deleteIDArray = $http->hasSessionVariable('DeleteGroupIDArray') ? $http->sessionVariable('DeleteGroupIDArray') : array();
$groupsInfo = array();
$deleteResult = array();
$deleteClassIDList = array();
foreach ($deleteIDArray as $deleteID) {
    $deletedClassName = '';
    $group = eZContentClassGroup::fetch($deleteID);
    if ($group != null) {
        $GroupName = $group->attribute('name');
        $classList = eZContentClassClassGroup::fetchClassList(null, $deleteID);
        $groupClassesInfo = array();
        foreach ($classList as $class) {
            $classID = $class->attribute("id");
            $classGroups = eZContentClassClassGroup::fetchGroupList($classID, 0);
            if (count($classGroups) == 1) {
                $classObject = eZContentclass::fetch($classID);
                $className = $classObject->attribute("name");
                $deletedClassName .= " '" . $className . "'";
                $deleteClassIDList[] = $classID;
                $groupClassesInfo[] = array('class_name' => $className, 'object_count' => $classObject->objectCount());
            }
        }
        if ($deletedClassName == '') {
            $deletedClassName = ezpI18n::tr('kernel/class', '(no classes)');
        }
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:removegroup.php

示例4: foreach

$Module->setTitle( ezpI18n::tr( 'kernel/class', 'Class list of group' ) . ' ' . $GroupID );
$tpl = eZTemplate::factory();

$user = eZUser::currentUser();
foreach( $TemplateData as $tpldata )
{
    $tplname = $tpldata["name"];

    $groupInfo =  eZContentClassGroup::fetch( $GroupID );

    if( !$groupInfo )
    {
       return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
    }

    $list = eZContentClassClassGroup::fetchClassList( 0, $GroupID, $asObject = true );
    $groupModifier = eZContentObject::fetch( $groupInfo->attribute( 'modifier_id') );
    $tpl->setVariable( $tplname, $list );
    $tpl->setVariable( "class_count", count( $list ) );
    $tpl->setVariable( "GroupID", $GroupID );
    $tpl->setVariable( "group", $groupInfo );
    $tpl->setVariable( "group_modifier", $groupModifier );
}

$group = eZContentClassGroup::fetch( $GroupID );
$groupName = $group->attribute( 'name' );


$tpl->setVariable( "module", $Module );

$Result = array();
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:31,代码来源:classlist.php


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