$oldParentTag->updateModified(); } } /* Extended Hook */ if (class_exists('ezpEvent', false)) { ezpEvent::getInstance()->filter('tag/merge', array('tag' => $tag, 'newParentTag' => $mainTag, 'oldParentTag' => $oldParentTag)); } $tag->moveChildrenBelowAnotherTag($mainTag); foreach ($tag->getSynonyms(true) as $synonym) { $synonym->registerSearchObjects(); $synonym->transferObjectsToAnotherTag($mainTag); $synonym->remove(); } $tag->registerSearchObjects(); $tag->transferObjectsToAnotherTag($mainTag); $tag->remove(); $mainTag->updateModified(); $db->commit(); return $Module->redirectToView('id', array($mainTag->attribute('id'))); } } $tpl = eZTemplate::factory(); $tpl->setVariable('tag', $tag); $tpl->setVariable('merge_allowed', $mergeAllowed); $tpl->setVariable('warning', $warning); $tpl->setVariable('error', $error); $Result = array(); $Result['content'] = $tpl->fetch('design:tags/merge.tpl'); $Result['ui_context'] = 'edit'; $Result['path'] = eZTagsObject::generateModuleResultPath($tag);
<?php /** @var eZModule $Module */ /** @var array $Params */ $http = eZHTTPTool::instance(); $keywordArray = $Params['Parameters']; if (!is_array($keywordArray) || empty($keywordArray)) { return $Module->handleError(eZError::KERNEL_NOT_FOUND, 'kernel'); } $tag = eZTagsObject::fetchByUrl($keywordArray); if (!$tag instanceof eZTagsObject) { return $Module->handleError(eZError::KERNEL_NOT_FOUND, 'kernel'); } $viewParameters = array(); if (isset($Params['Offset'])) { $viewParameters['offset'] = (int) $Params['Offset']; } $tpl = eZTemplate::factory(); $tpl->setVariable('tag', $tag); $tpl->setVariable('view_parameters', $viewParameters); $tpl->setVariable('show_reindex_message', false); if ($http->hasSessionVariable('eZTagsShowReindexMessage')) { $http->removeSessionVariable('eZTagsShowReindexMessage'); $tpl->setVariable('show_reindex_message', true); } $Result = array(); $Result['content'] = $tpl->fetch('design:tags/view.tpl'); $Result['path'] = eZTagsObject::generateModuleResultPath($tag, true, false, false);
$db = eZDB::instance(); foreach ($tagsList as $tag) { if ($tag->getSubTreeLimitationsCount() > 0 || $tag->attribute('main_tag_id') != 0) { continue; } $db->begin(); $parentTag = $tag->getParent(true); if ($parentTag instanceof eZTagsObject) { $parentTag->updateModified(); } /* Extended Hook */ if (class_exists('ezpEvent', false)) { ezpEvent::getInstance()->filter('tag/delete', $tag); } $tag->recursivelyDeleteTag(); $db->commit(); } $http->removeSessionVariable('eZTagsDeleteIDArray'); if ($parentTagID > 0) { return $Module->redirectToView('id', array($parentTagID)); } return $Module->redirectToView('dashboard', array()); } } $tpl = eZTemplate::factory(); $tpl->setVariable('tags', $tagsList); $Result = array(); $Result['content'] = $tpl->fetch('design:tags/deletetags.tpl'); $Result['ui_context'] = 'edit'; $Result['path'] = eZTagsObject::generateModuleResultPath(false, null, ezpI18n::tr('extension/eztags/tags/edit', 'Delete tags'));
$db = eZDB::instance(); $db->begin(); $languageMask = eZContentLanguage::maskByLocale(array($language->attribute('locale')), $http->hasPostVariable('AlwaysAvailable')); $tag = new eZTagsObject(array('parent_id' => $parentTagID, 'main_tag_id' => 0, 'depth' => $parentTag instanceof eZTagsObject ? $parentTag->attribute('depth') + 1 : 1, 'path_string' => $parentTag instanceof eZTagsObject ? $parentTag->attribute('path_string') : '/', 'main_language_id' => $language->attribute('id'), 'language_mask' => $languageMask), $language->attribute('locale')); $tag->store(); $translation = new eZTagsKeyword(array('keyword_id' => $tag->attribute('id'), 'language_id' => $language->attribute('id'), 'keyword' => $newKeyword, 'locale' => $language->attribute('locale'), 'status' => eZTagsKeyword::STATUS_PUBLISHED)); if ($http->hasPostVariable('AlwaysAvailable')) { $translation->setAttribute('language_id', $translation->attribute('language_id') + 1); } $translation->store(); $tag->setAttribute('path_string', $tag->attribute('path_string') . $tag->attribute('id') . '/'); $tag->store(); $tag->updateModified(); /* Extended Hook */ if (class_exists('ezpEvent', false)) { ezpEvent::getInstance()->filter('tag/add', array('tag' => $tag, 'parentTag' => $parentTag)); } $db->commit(); return $Module->redirectToView('id', array($tag->attribute('id'))); } } $tpl = eZTemplate::factory(); $tpl->setVariable('parent_id', $parentTagID); $tpl->setVariable('language', $language); $tpl->setVariable('error', $error); $tpl->setVariable('ui_context', 'edit'); $Result = array(); $Result['content'] = $tpl->fetch('design:tags/add.tpl'); $Result['ui_context'] = 'edit'; $Result['path'] = eZTagsObject::generateModuleResultPath($parentTag, null, ezpI18n::tr('extension/eztags/tags/edit', 'New tag'));
if (!empty($tagsSearchText)) { $sorts = array('eztags_keyword.keyword' => 'asc'); $limits = array('offset' => $offset, 'limit' => $limit); $params = array('eztags_keyword.keyword' => array('like', '%' . $tagsSearchText . '%')); $customConds = eZTagsObject::fetchCustomCondsSQL($params); if ($tagsSearchSubTree > 0) { if ($tagsIncludeSynonyms) { $customConds .= ' AND ( path_string LIKE "%/' . $tagsSearchSubTree . '/%" OR main_tag_id = ' . $tagsSearchSubTree . ' ) '; } else { $params['path_string'] = array('like', '%/' . $tagsSearchSubTree . '/%'); } } else { if (!$tagsIncludeSynonyms) { $params['main_tag_id'] = 0; } } $tagsSearchResults = eZPersistentObject::fetchObjectList(eZTagsObject::definition(), array(), $params, $sorts, $limits, true, false, array('DISTINCT eztags.*', array('operation' => 'eztags_keyword.keyword', 'name' => 'keyword'), array('operation' => 'eztags_keyword.locale', 'name' => 'locale')), array('eztags_keyword'), $customConds); $tagsSearchCount = eZPersistentObject::fetchObjectList(eZTagsObject::definition(), array(), $params, array(), null, false, false, array(array('operation' => 'COUNT( * )', 'name' => 'row_count')), array('eztags_keyword'), $customConds); $tagsSearchCount = $tagsSearchCount[0]['row_count']; } $tpl = eZTemplate::factory(); $tpl->setVariable('tags_search_text', $tagsSearchText); $tpl->setVariable('tags_search_subtree', $tagsSearchSubTree); $tpl->setVariable('tags_include_synonyms', $tagsIncludeSynonyms); $tpl->setVariable('tags_search_count', $tagsSearchCount); $tpl->setVariable('tags_search_results', $tagsSearchResults); $tpl->setVariable('view_parameters', $viewParameters); $Result = array(); $Result['content'] = $tpl->fetch('design:tags/search.tpl'); $Result['path'] = eZTagsObject::generateModuleResultPath(false, null, ezpI18n::tr('extension/eztags/tags/search', 'Tags search'));
<?php $http = eZHTTPTool::instance(); $viewParameters = array(); if (isset($Params['Offset'])) { $viewParameters['offset'] = (int) $Params['Offset']; } if (isset($Params['Tab'])) { $viewParameters['tab'] = trim($Params['Tab']); } $tpl = eZTemplate::factory(); $tpl->setVariable('view_parameters', $viewParameters); $tpl->setVariable('show_reindex_message', false); if ($http->hasSessionVariable('eZTagsShowReindexMessage')) { $http->removeSessionVariable('eZTagsShowReindexMessage'); $tpl->setVariable('show_reindex_message', true); } $Result = array(); $Result['content'] = $tpl->fetch('design:tags/dashboard.tpl'); $Result['path'] = eZTagsObject::generateModuleResultPath(false, null, ezpI18n::tr('extension/eztags/tags/view', 'Tags dashboard'));