diff --git a/classes/FileTableCallbackListener.php b/classes/FileTableCallbackListener.php deleted file mode 100644 index a9516de..0000000 --- a/classes/FileTableCallbackListener.php +++ /dev/null @@ -1,54 +0,0 @@ -get('monolog.logger.contao'); - $logger->log($level, "Callback called for " . $intId, array()); - - $strTable = $dc->table; - $strModel = '\\'.Model::getClassFromTable($strTable); - - // Return if the class does not exist (#9 thanks to tsarma) - if (!class_exists($strModel)) { - return; - } - - // Get object from model - $objModel = $strModel::findByPk($intId); - - if ($objModel !== null) { - $arrData = $objModel->row(); - - if (is_array($arrData) && count($arrData) > 0) { - // Load current data container - $logger->log($level, "Hallo: " . print_r($arrData, true), array()); - Controller::loadDataContainer($strTable); - - foreach ($arrData as $strField => $varValue) { - } - } - - // Save model object - $objModel->save(); - } - } - -} diff --git a/config/config.php b/config/config.php index b4f9613..8990e05 100644 --- a/config/config.php +++ b/config/config.php @@ -60,7 +60,7 @@ * CSS files */ - if (is_array($GLOBALS['TL_CSS'])) + if (isset($GLOBALS['TL_CSS']) && \is_array($GLOBALS['TL_CSS'])) { array_insert($GLOBALS['TL_CSS'], 1, 'system/modules/tags/assets/tag.css'); } @@ -72,14 +72,14 @@ /** * JavaScript files */ - if (is_array($GLOBALS['TL_JAVASCRIPT'])) - { - array_insert($GLOBALS['TL_JAVASCRIPT'], 1, 'system/modules/tags/assets/tag.js'); - } - else - { - $GLOBALS['TL_JAVASCRIPT'] = array('system/modules/tags/assets/tag.js'); - } + if (isset($GLOBALS['TL_JAVASCRIPT']) && \is_array($GLOBALS['TL_JAVASCRIPT'])) + { + \array_insert($GLOBALS['TL_JAVASCRIPT'], 1, 'system/modules/tags/assets/tag.js'); + } + else + { + $GLOBALS['TL_JAVASCRIPT'] = array('system/modules/tags/assets/tag.js'); + } } /** @@ -104,7 +104,11 @@ /** * Add 'tag' to the URL keywords to prevent problems with URL manipulating modules like folderurl */ -$GLOBALS['TL_CONFIG']['urlKeywords'] .= (strlen(trim($GLOBALS['TL_CONFIG']['urlKeywords'])) ? ',' : '') . 'tag'; +if (isset($GLOBALS['TL_CONFIG']['urlKeywords'])) { + $GLOBALS['TL_CONFIG']['urlKeywords'] .= (strlen(trim($GLOBALS['TL_CONFIG']['urlKeywords'])) ? ',' : '') . 'tag'; +} else { + $GLOBALS['TL_CONFIG']['urlKeywords'] = 'tag'; +} $GLOBALS['tags']['showInFeeds'] = true; $GLOBALS['TL_FFL']['tag'] = 'TagFieldMemberFrontend'; diff --git a/dca/tl_article.php b/dca/tl_article.php index 112f18a..2ff1c34 100644 --- a/dca/tl_article.php +++ b/dca/tl_article.php @@ -8,9 +8,9 @@ * @license LGPL-3.0+ */ -class tl_article_tags extends tl_article +class tl_article_tags extends \Backend { - public function removeArticle($dc) + public function removeArticle(\DataContainer $dc, $undoId) { $this->Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") ->execute($dc->table, $dc->id); @@ -23,7 +23,7 @@ public function removeArticle($dc) } } - public function removePage($dc) + public function removePage(\DataContainer $dc, $undoId) { // remove tags of all articles in the page $arrArticles = $this->Database->prepare("SELECT DISTINCT id FROM tl_article WHERE pid = ?") @@ -42,29 +42,16 @@ public function removePage($dc) } } - public function onCopy($dc) - { - if (is_array($this->Session->get('tl_article_copy'))) - { - foreach ($this->Session->get('tl_article_copy') as $data) - { - $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)") - ->execute($dc->id, $data['tag'], $data['table']); - } - } - $this->Session->set('tl_article_copy', null); - if (\Input::get('act') != 'copy') - { - return; - } - $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?") - ->execute(\Input::get('id'), $dc->table); + public function onCopy($insertID, \DataContainer $dc) + { + $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?")->execute($dc->id, $dc->table); $tags = array(); - while ($objTags->next()) - { - array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + while ($objTags->next()) { + \array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + } + foreach ($tags as $entry) { + $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)")->execute($insertID, $entry['tag'], $entry['table']); } - $this->Session->set("tl_article_copy", $tags); } } @@ -73,7 +60,11 @@ public function onCopy($dc) * Change tl_article default palette */ -$disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +if (isset($GLOBALS['TL_CONFIG']['disabledTagObjects'])) { + $disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +} else { + $disabledObjects = array(); +} if (!in_array('tl_article', $disabledObjects)) { $GLOBALS['TL_DCA']['tl_article']['palettes']['default'] = str_replace("keywords", "keywords;{tags_legend},tags,tags_showtags", $GLOBALS['TL_DCA']['tl_article']['palettes']['default']); @@ -81,7 +72,7 @@ public function onCopy($dc) $GLOBALS['TL_DCA']['tl_article']['subpalettes']['tags_showtags'] = 'tags_max_tags,tags_relevance,tags_jumpto'; $GLOBALS['TL_DCA']['tl_article']['config']['ondelete_callback'][] = array('tl_article_tags', 'removeArticle'); $GLOBALS['TL_DCA']['tl_page']['config']['ondelete_callback'][] = array('tl_article_tags', 'removePage'); - $GLOBALS['TL_DCA']['tl_article']['config']['onload_callback'][] = array('tl_article_tags', 'onCopy'); + $GLOBALS['TL_DCA']['tl_article']['config']['oncopy_callback'][] = array('tl_article_tags', 'onCopy'); } $GLOBALS['TL_DCA']['tl_article']['fields']['tags'] = array diff --git a/dca/tl_calendar_events.php b/dca/tl_calendar_events.php index 1d6db12..a57ad5d 100644 --- a/dca/tl_calendar_events.php +++ b/dca/tl_calendar_events.php @@ -22,48 +22,39 @@ } } -class tl_calendar_events_tags extends tl_calendar_events +class tl_calendar_events_tags extends \Backend { - public function deleteEvents($dc) + public function deleteEvents(\DataContainer $dc, $undoId) { $this->Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") ->execute($dc->table, $dc->id); } - public function onCopy($dc) - { - if (is_array($this->Session->get('tl_calendar_events_copy'))) - { - foreach ($this->Session->get('tl_calendar_events_copy') as $data) - { - $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)") - ->execute($dc->id, $data['tag'], $data['table']); - } - } - $this->Session->set('tl_calendar_events_copy', null); - if (\Input::get('act') != 'copy') - { - return; - } - $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?") - ->execute(\Input::get('id'), $dc->table); + public function onCopy($insertID, \DataContainer $dc) + { + $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?")->execute($dc->id, $dc->table); $tags = array(); - while ($objTags->next()) - { - array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + while ($objTags->next()) { + \array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + } + foreach ($tags as $entry) { + $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)")->execute($insertID, $entry['tag'], $entry['table']); } - $this->Session->set("tl_calendar_events_copy", $tags); } } /** * Change tl_news palettes */ -$disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +if (isset($GLOBALS['TL_CONFIG']['disabledTagObjects'])) { + $disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +} else { + $disabledObjects = array(); +} if (!in_array('tl_calendar_events', $disabledObjects)) { $GLOBALS['TL_DCA']['tl_calendar_events']['config']['ondelete_callback'][] = array('tl_calendar_events_tags', 'deleteEvents'); - $GLOBALS['TL_DCA']['tl_calendar_events']['config']['onload_callback'][] = array('tl_calendar_events_tags', 'onCopy'); + $GLOBALS['TL_DCA']['tl_calendar_events']['config']['oncopy_callback'][] = array('tl_calendar_events_tags', 'onCopy'); $GLOBALS['TL_DCA']['tl_calendar_events']['palettes']['default'] = str_replace("author", "author,tags", $GLOBALS['TL_DCA']['tl_calendar_events']['palettes']['default']); } $GLOBALS['TL_DCA']['tl_calendar_events']['fields']['tags'] = array diff --git a/dca/tl_content.php b/dca/tl_content.php index 397e12b..bf658b7 100644 --- a/dca/tl_content.php +++ b/dca/tl_content.php @@ -8,7 +8,11 @@ * @license LGPL-3.0+ */ -$disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +if (isset($GLOBALS['TL_CONFIG']['disabledTagObjects'])) { + $disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +} else { + $disabledObjects = array(); +} if (!in_array('tl_content', $disabledObjects)) { foreach ($GLOBALS['TL_DCA']['tl_content']['palettes'] as $key => $palette) @@ -25,7 +29,7 @@ $GLOBALS['TL_DCA']['tl_content']['palettes']['headline'] = str_replace('guests','guests,tagsonly', $GLOBALS['TL_DCA']['tl_content']['palettes']['headline']); $GLOBALS['TL_DCA']['tl_content']['config']['ondelete_callback'][] = array('tl_content_tags', 'removeContentElement'); - $GLOBALS['TL_DCA']['tl_content']['config']['onload_callback'][] = array('tl_content_tags', 'onCopy'); + $GLOBALS['TL_DCA']['tl_content']['config']['oncopy_callback'][] = array('tl_content_tags', 'onCopy'); $GLOBALS['TL_DCA']['tl_content']['palettes']['gallery'] = str_replace('numberOfItems','numberOfItems,tag_filter,tag_ignore;', $GLOBALS['TL_DCA']['tl_content']['palettes']['gallery']); } @@ -68,37 +72,24 @@ * @author Helmut Schottmüller * @package Controller */ -class tl_content_tags extends tl_content +class tl_content_tags extends \Backend { - public function removeContentElement($dc) + public function removeContentElement(\DataContainer $dc, $undoId) { $this->Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") ->execute($dc->table, $dc->id); } - public function onCopy($dc) - { - if (is_array($this->Session->get('tl_content_copy'))) - { - foreach ($this->Session->get('tl_content_copy') as $data) - { - $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)") - ->execute($dc->id, $data['tag'], $data['table']); - } - } - $this->Session->set('tl_content_copy', null); - if (\Input::get('act') != 'copy') - { - return; - } - $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?") - ->execute(\Input::get('id'), $dc->table); + public function onCopy($insertID, \DataContainer $dc) + { + $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?")->execute($dc->id, $dc->table); $tags = array(); - while ($objTags->next()) - { - array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + while ($objTags->next()) { + \array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + } + foreach ($tags as $entry) { + $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)")->execute($insertID, $entry['tag'], $entry['table']); } - $this->Session->set("tl_content_copy", $tags); } } diff --git a/dca/tl_faq.php b/dca/tl_faq.php index 69696ad..3ab4936 100644 --- a/dca/tl_faq.php +++ b/dca/tl_faq.php @@ -14,12 +14,16 @@ * Change tl_faq default palette */ - $disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); + if (isset($GLOBALS['TL_CONFIG']['disabledTagObjects'])) { + $disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); + } else { + $disabledObjects = array(); + } if (!in_array('tl_article', $disabledObjects)) { $GLOBALS['TL_DCA']['tl_faq']['palettes']['default'] = str_replace("author", "author,tags", $GLOBALS['TL_DCA']['tl_faq']['palettes']['default']); $GLOBALS['TL_DCA']['tl_faq']['config']['ondelete_callback'][] = array('tl_faq_tags', 'removeFAQ'); - $GLOBALS['TL_DCA']['tl_faq']['config']['onload_callback'][] = array('tl_faq_tags', 'onCopy'); + $GLOBALS['TL_DCA']['tl_faq']['config']['oncopy_callback'][] = array('tl_faq_tags', 'onCopy'); } $GLOBALS['TL_DCA']['tl_faq']['fields']['tags'] = array @@ -29,37 +33,24 @@ 'eval' => array('tl_class'=>'clr long') ); - class tl_faq_tags extends tl_faq + class tl_faq_tags extends \Backend { - public function removeFAQ($dc) + public function removeFAQ(\DataContainer $dc, $undoId) { $this->Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") ->execute($dc->table, $dc->id); } - public function onCopy($dc) + public function onCopy($insertID, \DataContainer $dc) { - if (is_array($this->Session->get('tl_faq_copy'))) - { - foreach ($this->Session->get('tl_faq_copy') as $data) - { - $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)") - ->execute($dc->id, $data['tag'], $data['table']); - } - } - $this->Session->set('tl_faq_copy', null); - if (\Input::get('act') != 'copy') - { - return; - } - $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?") - ->execute(\Input::get('id'), $dc->table); + $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?")->execute($dc->id, $dc->table); $tags = array(); - while ($objTags->next()) - { - array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + while ($objTags->next()) { + \array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + } + foreach ($tags as $entry) { + $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)")->execute($insertID, $entry['tag'], $entry['table']); } - $this->Session->set("tl_faq_copy", $tags); } } diff --git a/dca/tl_files.php b/dca/tl_files.php index 28bc031..3c80d12 100644 --- a/dca/tl_files.php +++ b/dca/tl_files.php @@ -1,8 +1,5 @@ Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") - ->execute($dc->table, $dc->id); - } - - public function onCopy($source, $destination, \DataContainer $dc) - { - $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?") - ->execute($source, $dc->table); - $tags = array(); - while ($objTags->next()) - { - array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); - } - foreach ($tags as $entry) { - $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)") - ->execute($destination, $entry['tag'], $entry['table']); + public function removeContentElement($source, \DataContainer $dc) + { + $fileModel = \FilesModel::findByPath($source); + if ($fileModel != null) { + $this->Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") + ->execute($dc->table, $fileModel->id); } } + + public function onCopy($source, $destination, \DataContainer $dc) + { + $sourceModel = \FilesModel::findByPath($source); + $destModel = \FilesModel::findByPath($destination); + + if ($sourceModel != null && $destModel != null) { + $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?")->execute($sourceModel->id, $dc->table); + $tags = array(); + while ($objTags->next()) { + \array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + } + foreach ($tags as $entry) { + $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)")->execute($destModel->id, $entry['tag'], $entry['table']); + } + } + } } diff --git a/dca/tl_member.php b/dca/tl_member.php index d93b340..4ebbc95 100644 --- a/dca/tl_member.php +++ b/dca/tl_member.php @@ -8,39 +8,23 @@ * @filesource */ -class tl_member_tags extends tl_member +class tl_member_tags extends \Backend { - public function deleteMember($dc) + public function deleteMember(\DataContainer $dc, $undoId) { $this->Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") ->execute($dc->table, $dc->id); } - public function onCopy($dc = null) + public function onCopy($insertID, \DataContainer $dc) { - if (is_object($dc)) - { - if (is_array($this->Session->get('tl_member_copy'))) - { - foreach ($this->Session->get('tl_member_copy') as $data) - { - $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)") - ->execute($dc->id, $data['tag'], $data['table']); - } - } - $this->Session->set('tl_member_copy', null); - if ($this->Input->get('act') != 'copy') - { - return; - } - $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?") - ->execute($this->Input->get('id'), $dc->table); - $tags = array(); - while ($objTags->next()) - { - array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); - } - $this->Session->set("tl_member_copy", $tags); + $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?")->execute($dc->id, $dc->table); + $tags = array(); + while ($objTags->next()) { + \array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + } + foreach ($tags as $entry) { + $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)")->execute($insertID, $entry['tag'], $entry['table']); } } } @@ -48,11 +32,15 @@ public function onCopy($dc = null) /** * Change tl_member palettes */ -$disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +if (isset($GLOBALS['TL_CONFIG']['disabledTagObjects'])) { + $disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +} else { + $disabledObjects = array(); +} if (!in_array('tl_member', $disabledObjects)) { $GLOBALS['TL_DCA']['tl_member']['config']['ondelete_callback'][] = array('tl_member_tags', 'deleteMember'); - $GLOBALS['TL_DCA']['tl_member']['config']['onload_callback'][] = array('tl_member_tags', 'onCopy'); + $GLOBALS['TL_DCA']['tl_member']['config']['oncopy_callback'][] = array('tl_member_tags', 'onCopy'); $GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace("{address_legend", "{categories_legend},tags;{address_legend", $GLOBALS['TL_DCA']['tl_member']['palettes']['default']); } diff --git a/dca/tl_module.php b/dca/tl_module.php index ccf21d4..348983d 100644 --- a/dca/tl_module.php +++ b/dca/tl_module.php @@ -8,7 +8,7 @@ * @license LGPL-3.0+ */ -class tl_module_tags extends tl_module +class tl_module_tags extends \Backend { /** * Return available tag tables @@ -79,7 +79,7 @@ public function getTagScopeTemplates(DataContainer $dc) } } -class tl_module_tags_articles extends tl_module +class tl_module_tags_articles extends \Backend { public function getArticlelistTemplates(DataContainer $dc) { @@ -111,7 +111,7 @@ public function getArticlelistOrder(DataContainer $dc) * @author Helmut Schottmüller * @package Controller */ -class tl_module_tags_events extends tl_module +class tl_module_tags_events extends \Backend { /** * Return available calendars @@ -142,7 +142,7 @@ public function getCalendars() * @author Helmut Schottmüller * @package Controller */ -class tl_module_tags_news extends tl_module +class tl_module_tags_news extends \Backend { /** * Return available news archives diff --git a/dca/tl_news.php b/dca/tl_news.php index bbb3e86..2681eeb 100644 --- a/dca/tl_news.php +++ b/dca/tl_news.php @@ -23,48 +23,39 @@ } -class tl_news_tags extends tl_news +class tl_news_tags extends \Backend { - public function deleteNews($dc) + public function deleteNews(\DataContainer $dc, $undoId) { $this->Database->prepare("DELETE FROM tl_tag WHERE from_table = ? AND tid = ?") ->execute($dc->table, $dc->id); } - public function onCopy($dc) + public function onCopy($insertID, \DataContainer $dc) { - if (is_array($this->Session->get('tl_news_copy'))) - { - foreach ($this->Session->get('tl_news_copy') as $data) - { - $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)") - ->execute($dc->id, $data['tag'], $data['table']); - } - } - $this->Session->set('tl_news_copy', null); - if (\Input::get('act') != 'copy') - { - return; - } - $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?") - ->execute(\Input::get('tid'), $dc->table); + $objTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE tid = ? AND from_table = ?")->execute($dc->id, $dc->table); $tags = array(); - while ($objTags->next()) - { - array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + while ($objTags->next()) { + \array_push($tags, array("table" => $dc->table, "tag" => $objTags->tag)); + } + foreach ($tags as $entry) { + $this->Database->prepare("INSERT INTO tl_tag (tid, tag, from_table) VALUES (?, ?, ?)")->execute($insertID, $entry['tag'], $entry['table']); } - $this->Session->set("tl_news_copy", $tags); } } /** * Change tl_news palettes */ -$disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +if (isset($GLOBALS['TL_CONFIG']['disabledTagObjects'])) { + $disabledObjects = deserialize($GLOBALS['TL_CONFIG']['disabledTagObjects'], true); +} else { + $disabledObjects = array(); +} if (!in_array('tl_news', $disabledObjects)) { $GLOBALS['TL_DCA']['tl_news']['config']['ondelete_callback'][] = array('tl_news_tags', 'deleteNews'); - $GLOBALS['TL_DCA']['tl_news']['config']['onload_callback'][] = array('tl_news_tags', 'onCopy'); + $GLOBALS['TL_DCA']['tl_news']['config']['oncopy_callback'][] = array('tl_news_tags', 'onCopy'); $GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = str_replace("author", "author,tags", $GLOBALS['TL_DCA']['tl_news']['palettes']['default']); $GLOBALS['TL_DCA']['tl_news']['palettes']['internal'] = str_replace("author", "author,tags", $GLOBALS['TL_DCA']['tl_news']['palettes']['internal']); $GLOBALS['TL_DCA']['tl_news']['palettes']['external'] = str_replace("author", "author,tags", $GLOBALS['TL_DCA']['tl_news']['palettes']['external']); diff --git a/modules/ModuleTagCloud.php b/modules/ModuleTagCloud.php index fe58390..de36ac0 100644 --- a/modules/ModuleTagCloud.php +++ b/modules/ModuleTagCloud.php @@ -219,7 +219,6 @@ protected function showTags() $this->arrTopTenTags[$idx]['tag_url'] = $strUrl; } $ts = deserialize(\Input::cookie('tagcloud_states'), true); -// $ts = $this->Session->get('tagcloud_states'); $this->Template->expandedTopTen = (strlen($ts[$this->id]['topten'])) ? ((strcmp($ts[$this->id]['topten'], 'none') == 0) ? 0 : 1) : $this->tag_topten_expanded; $this->Template->expandedAll = (strlen($ts[$this->id]['alltags'])) ? ((strcmp($ts[$this->id]['alltags'], 'none') == 0) ? 0 : 1) : $this->tag_all_expanded; $this->Template->expandedRelated = (strlen($ts[$this->id]['related'])) ? ((strcmp($ts[$this->id]['related'], 'none') == 0) ? 0 : 1) : 1;