Exemple #1
0
 private function section_list()
 {
     $sectionObjects = eZSection::fetchList();
     $results = array();
     $results[] = array("Id", "NavigationPartIdentifier", "Count", "Name");
     foreach ($sectionObjects as $section) {
         $count = eZSectionFunctionCollection::fetchObjectListCount($section->ID);
         $count = $count["result"];
         $results[] = array($section->ID, $section->NavigationPartIdentifier, $count, $section->Name);
     }
     eep::printTable($results, "all sections");
 }
Exemple #2
0
 function attribute($attr)
 {
     switch ($attr) {
         case 'sections':
             #include_once( 'kernel/classes/ezsection.php' );
             $sections = eZSection::fetchList(false);
             foreach (array_keys($sections) as $key) {
                 $section = $sections[$key];
                 $section['Name'] = $section['name'];
                 $section['value'] = $section['id'];
             }
             return $sections;
             break;
     }
     $eventValue = eZWorkflowEventType::attribute($attr);
     return $eventValue;
 }
 function attribute($attr)
 {
     switch ($attr) {
         case 'sections':
             $sections = eZSection::fetchList(false);
             foreach ($sections as $key => $section) {
                 $sections[$key]['Name'] = $section['name'];
                 $sections[$key]['value'] = $section['id'];
             }
             return $sections;
             break;
         case 'languages':
             return eZContentLanguage::fetchList();
             break;
     }
     return eZWorkflowEventType::attribute($attr);
 }
if ($http->hasVariable('SubTreeArray')) {
    if (is_array($http->variable('SubTreeArray'))) {
        $subTreeList = $http->variable('SubTreeArray');
    } else {
        $subTreeList = array($http->variable('SubTreeArray'));
    }
    foreach ($subTreeList as $subTreeItem) {
        // as form input is generally a string, is_int cannot be used for checking the value type
        if (is_numeric($subTreeItem) && $subTreeItem > 0) {
            $subTreeArray[] = $subTreeItem;
        }
    }
}
$Module->setTitle("Search for: {$searchText}");
$classArray = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => 'asc'));
$sectionArray = eZSection::fetchList();
$searchArray = eZSearch::buildSearchArray();
if ($useSearchCode) {
    $searchResult = eZSearch::search($searchText, array('SearchSectionID' => $searchSectionID, 'SearchContentClassID' => $searchContentClassID, 'SearchContentClassAttributeID' => $searchContentClassAttributeID, 'SearchSubTreeArray' => $subTreeArray, 'SearchDate' => $searchDate, 'SearchTimestamp' => $searchTimestamp, 'SearchLimit' => $pageLimit, 'SearchOffset' => $Offset), $searchArray);
    if (strlen(trim($searchText)) == 0 && count($searchArray) > 0) {
        $searchText = 'search by additional parameter';
    }
}
$viewParameters = array('offset' => $Offset);
$searchData = false;
$tpl->setVariable("search_data", $searchData);
$tpl->setVariable('search_contentclass_id', $searchContentClassID);
$tpl->setVariable('search_contentclass_attribute_id', $searchContentClassAttributeID);
$tpl->setVariable('search_section_id', $searchSectionID);
$tpl->setVariable('search_date', $searchDate);
$tpl->setVariable('search_timestamp', $searchTimestamp);
    // we changed prices => remove content cache
    eZContentCacheManager::clearAllContentCache();

    return $module->redirectTo( $module->functionURI( 'discountgroupview' ) . '/' . $discountGroupID );
}

$classList = eZContentClass::fetchList();
$productClassList = array();
foreach ( $classList as $class )
{
    if ( eZShopFunctions::isProductClass( $class ) )
        $productClassList[] = $class;
}

$sectionList = eZSection::fetchList();

$tpl = eZTemplate::factory();

$tpl->setVariable( 'module', $module );
$tpl->setVariable( 'discountgroup_id', $discountGroupID );
$tpl->setVariable( 'discountrule', $discountRule );

$tpl->setVariable( 'product_class_list', $productClassList );
$tpl->setVariable( 'section_list', $sectionList );

$tpl->setVariable( 'class_limitation_list', $discountRuleSelectedClasses );
$tpl->setVariable( 'section_limitation_list', $discountRuleSelectedSections );
$tpl->setVariable( 'product_list', $productList );

$tpl->setVariable( 'class_any_selected', in_array( -1, $discountRuleSelectedClasses ) );
 public static function fetchSectionList()
 {
     return array('result' => eZSection::fetchList());
 }
    /**
     * @return eZSection[]|null
     */
    function allowedAssignSectionList()
    {
        $currentUser = eZUser::currentUser();
        $sectionIDList = $currentUser->canAssignToObjectSectionList( $this );

        $sectionList = array();
        if ( in_array( '*', $sectionIDList ) )
        {
            $sectionList = eZSection::fetchList( false );
        }
        else
        {
            $sectionIDList[] = $this->attribute( 'section_id' );
            $sectionList = eZSection::fetchFilteredList( array( 'id' => array( $sectionIDList ) ), false, false, false );
        }
        return $sectionList;
    }
 function fetchSectionList()
 {
     $sectionObjects = eZSection::fetchList();
     return array('result' => $sectionObjects);
 }
 function attribute($attr)
 {
     switch ($attr) {
         case 'sections':
             $sections = eZSection::fetchList(false);
             foreach ($sections as $key => $section) {
                 $sections[$key]['Name'] = $section['name'];
                 $sections[$key]['value'] = $section['id'];
             }
             return $sections;
             break;
         case 'languages':
             return eZContentLanguage::fetchList();
             break;
         case 'usergroups':
             $groups = eZPersistentObject::fetchObjectList(eZContentObject::definition(), array('id', 'name'), array('contentclass_id' => 3, 'status' => eZContentObject::STATUS_PUBLISHED), null, null, false);
             foreach ($groups as $key => $group) {
                 $groups[$key]['Name'] = $group['name'];
                 $groups[$key]['value'] = $group['id'];
             }
             return $groups;
             break;
         case 'contentclass_list':
             $classes = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => 'asc'));
             $classList = array();
             for ($i = 0; $i < count($classes); $i++) {
                 $classList[$i]['Name'] = $classes[$i]->attribute('name');
                 $classList[$i]['value'] = $classes[$i]->attribute('id');
             }
             return $classList;
             break;
         case 'workflow_list':
             $workflows = eZWorkflow::fetchList();
             $workflowList = array();
             for ($i = 0; $i < count($workflows); $i++) {
                 $workflowList[$i]['Name'] = $workflows[$i]->attribute('name');
                 $workflowList[$i]['value'] = $workflows[$i]->attribute('id');
             }
             return $workflowList;
             break;
     }
     return eZWorkflowEventType::attribute($attr);
 }
Exemple #10
0
    if ($result === false) {
        $setup["database_ok"] = false;
        break;
    }
}
// Check if content class for newsletter exists
$setup["content_classes_ok"] = is_object(eZContentClass::fetchByIdentifier('jaj_newsletter'));
// Check for newsletter folder
$newsletter_id = $newsletter_ini->variable('NewsletterSettings', 'RootFolderNodeId');
$newsletter_node = eZContentObject::fetchByNodeID($newsletter_id);
$setup["newsletter_folder_ok"] = $newsletter_id && is_object($newsletter_node);
$setup["newsletter_settings_ok"] = $newsletter_ini->variable('NewsletterSettings', 'FromEmail') && $newsletter_ini->variable('NewsletterSettings', 'FromName') && $newsletter_ini->variable('NewsletterSettings', 'ReplyEmail');
// Check for newsletter section
// And check that newsletter node is assigned to section
//$section = eZSection::fetchByIdentifier("jaj_newsletter");
$sections = eZSection::fetchList();
foreach ($sections as $s) {
    if ($s->attribute("identifier") == "jaj_newsletter") {
        $section = $s;
        break;
    }
}
if (is_object($newsletter_node) && is_object($section)) {
    $setup["newsletter_section_ok"] = $newsletter_node->SectionID == $section->ID;
} else {
    $setup["newsletter_section_ok"] = false;
}
// TODO: Add check for access rights for section
$anonymous = eZUser::fetch(eZUser::anonymousId());
//var_dump( $anonymous );
$jaj_subscription_access = $anonymous->hasAccessTo('jaj_newsletter', 'manage_subscription');