/** * Returns the languages the object has been translated into/exists in as a JSON string * * @return bool|string */ function availableLanguagesJsArray() { return eZContentLanguage::jsArrayByMask( $this->LanguageMask ); }
function initContentStructureTree($rootNodeID, $fetchHidden, $classFilter = false) { // create initial subtree with root node and empty children. $nodes = false; $rootTreeNode = eZContentObjectTreeNode::fetch($rootNodeID); if ($rootTreeNode && $rootTreeNode->canRead()) { if (!$fetchHidden && ($rootTreeNode->attribute('is_hidden') || $rootTreeNode->attribute('is_invisible'))) { return false; } else { $contentObject = $rootTreeNode->attribute('object'); $viewNodeAllowed = true; if (is_array($classFilter) && count($classFilter) > 0) { $contentClassIdentifier = $contentObject->attribute('class_identifier'); if (!in_array($contentClassIdentifier, $classFilter)) { $viewNodeAllowed = false; } } if ($viewNodeAllowed) { $rootNode = array('node' => array('node_id' => $rootTreeNode->attribute('node_id'), 'path_identification_string' => $rootTreeNode->pathWithNames(), 'children_count' => $rootTreeNode->attribute('children_count'), 'sort_array' => $rootTreeNode->attribute('sort_array'), 'path_string' => $rootTreeNode->attribute('path_string'), 'depth' => $rootTreeNode->attribute('depth'), 'is_hidden' => $rootTreeNode->attribute('is_hidden'), 'is_invisible' => $rootTreeNode->attribute('is_invisible')), 'classes_js_array' => eZContentObjectTreeNode::availableClassListJsArray(array('node' => &$rootTreeNode)), 'object' => array('id' => $contentObject->attribute('id'), 'name' => $contentObject->attribute('name'), 'class_identifier' => $contentObject->attribute('class_identifier'), 'class_name' => $contentObject->attribute('class_name'), 'published' => $contentObject->attribute('published'), 'is_container' => true, 'language_js_array' => eZContentLanguage::jsArrayByMask($contentObject->attribute('language_mask')))); $nodes = array('parent_node' => &$rootNode, 'children' => array()); } } } return $nodes; }