public function allCategories($bGetCategoriesWithDocumentsOnly = false) { $oQuery = DocumentCategoryQuery::create()->distinct()->filterByIsExternallyManaged(false); if ($bGetCategoriesWithDocumentsOnly) { $oQuery->joinDocument(null, Criteria::INNER_JOIN); if (is_string($bGetCategoriesWithDocumentsOnly)) { $oQuery->useDocumentQuery()->filterByDocumentKind($bGetCategoriesWithDocumentsOnly)->endUse(); } } return WidgetJsonFileModule::jsonBaseObjects($oQuery->orderByName()->find(), array('id', 'name')); }
public function getLanguages($bUseAdminLanguages = false, $bDisplayInOriginalLanguage = false) { if ($bUseAdminLanguages) { $aLanguages = self::getAdminLanguages($bDisplayInOriginalLanguage); $aResult = array(); foreach ($aLanguages as $sLanguageId => $sLanguageName) { $aResult[] = array('id' => $sLanguageId, 'language_name' => $sLanguageName); } return $aResult; } else { return WidgetJsonFileModule::jsonBaseObjects(LanguageQuery::create()->orderById()->find(), array('id', 'language_name')); } }
public function getConfigurationModes() { $aResult = array(); $aDocumentCategories = DocumentListFrontendModule::getCategoryOptions(); $aResult['document_categories'] = WidgetJsonFileModule::jsonOrderedObject($aDocumentCategories); $aResult['tags'] = WidgetJsonFileModule::jsonOrderedObject(DocumentListFrontendModule::getTagOptions()); $aResult['document_kind'] = WidgetJsonFileModule::jsonOrderedObject(array('' => TranslationPeer::getString('wns.document_kind.all')) + DocumentKindInputWidgetModule::getDocumentKindsAssoc()); $aResult['list_template'] = array_keys(DocumentListFrontendModule::getTemplateOptions()); if (count($aDocumentCategories) > 0) { $aResult['sort_by'] = DocumentListFrontendModule::getSortOptions(); $aResult['sort_order'] = DocumentListFrontendModule::getSortOrders(); } return $aResult; }
public function listImages() { $oCriteria = DocumentQuery::create(); if ($this->aDisplayedCategories !== null) { $oCategoriesCriterion = null; foreach ($this->aDisplayedCategories as $sValue) { $mComparison = $sValue === CriteriaListWidgetDelegate::SELECT_WITHOUT ? Criteria::ISNULL : Criteria::EQUAL; $sValue = $mComparison === Criteria::ISNULL ? null : $sValue; if ($oCategoriesCriterion === null) { $oCategoriesCriterion = $oCriteria->getNewCriterion(DocumentPeer::DOCUMENT_CATEGORY_ID, $sValue, $mComparison); } else { $oCategoriesCriterion->addOr($oCriteria->getNewCriterion(DocumentPeer::DOCUMENT_CATEGORY_ID, $sValue, $mComparison)); } } $oCriteria->add($oCategoriesCriterion); } $oCriteria->filterByDocumentKind('image'); // always exclude externally managed images $oCriteria->excludeExternallyManaged()->orderByUpdatedAt('desc'); return WidgetJsonFileModule::jsonBaseObjects($oCriteria->find(), array('name', 'description', 'id', 'language_id')); }
public function rowFromData($aRowData) { $oRow = $this->oDelegate->rowFromData($aRowData); if ($oRow === null) { return null; } $aRow = array($oRow); $aRow = WidgetJsonFileModule::jsonBaseObjects($aRow, $this->columnsForJson()); return $aRow[0]; }
public function allRoles() { $oCriteria = new Criteria(); $oCriteria->addAscendingOrderByColumn(RolePeer::ROLE_KEY); return WidgetJsonFileModule::jsonBaseObjects(RolePeer::doSelect($oCriteria), array('role_key', 'description')); }
public function getDocumentations() { return WidgetJsonFileModule::jsonBaseObjects(DocumentationQuery::create()->orderByName()->find(), array('id', 'name')); }
public function allGroups() { return WidgetJsonFileModule::jsonBaseObjects(GroupQuery::create()->orderByName()->find(), array('id', 'name')); }