diff --git a/plugins/page/classes/actions/ActionPage.class.php b/plugins/page/classes/actions/ActionPage.class.php index 98c22c8f..5a085821 100644 --- a/plugins/page/classes/actions/ActionPage.class.php +++ b/plugins/page/classes/actions/ActionPage.class.php @@ -118,6 +118,7 @@ class PluginPage_ActionPage extends ActionPlugin { $_REQUEST['page_active']=$oPageEdit->getActive(); $_REQUEST['page_main']=$oPageEdit->getMain(); $_REQUEST['page_sort']=$oPageEdit->getSort(); + $_REQUEST['page_auto_br']=$oPageEdit->getAutoBr(); $_REQUEST['page_id']=$oPageEdit->getId(); } else { /** @@ -198,6 +199,7 @@ class PluginPage_ActionPage extends ActionPlugin { * Обновляем свойства страницы */ $oPageEdit->setActive(getRequest('page_active') ? 1 : 0); + $oPageEdit->setAutoBr(getRequest('page_auto_br') ? 1 : 0); $oPageEdit->setMain(getRequest('page_main') ? 1 : 0); $oPageEdit->setDateEdit(date("Y-m-d H:i:s")); if (getRequest('page_pid')==0) { @@ -242,6 +244,7 @@ class PluginPage_ActionPage extends ActionPlugin { */ $oPage=Engine::GetEntity('PluginPage_Page'); $oPage->setActive(getRequest('page_active') ? 1 : 0); + $oPage->setAutoBr(getRequest('page_auto_br') ? 1 : 0); $oPage->setMain(getRequest('page_main') ? 1 : 0); $oPage->setDateAdd(date("Y-m-d H:i:s")); if (getRequest('page_pid')==0) { diff --git a/plugins/page/classes/modules/page/entity/Page.entity.class.php b/plugins/page/classes/modules/page/entity/Page.entity.class.php index 70a6063f..b0424139 100644 --- a/plugins/page/classes/modules/page/entity/Page.entity.class.php +++ b/plugins/page/classes/modules/page/entity/Page.entity.class.php @@ -55,7 +55,10 @@ class PluginPage_ModulePage_EntityPage extends Entity } public function getSort() { return $this->_aData['page_sort']; - } + } + public function getAutoBr() { + return $this->_aData['page_auto_br']; + } public function getLevel() { return $this->_aData['level']; @@ -103,5 +106,8 @@ class PluginPage_ModulePage_EntityPage extends Entity public function setSort($data) { $this->_aData['page_sort']=$data; } + public function setAutoBr($data) { + $this->_aData['page_auto_br']=$data; + } } ?> \ No newline at end of file diff --git a/plugins/page/classes/modules/page/mapper/Page.mapper.class.php b/plugins/page/classes/modules/page/mapper/Page.mapper.class.php index 2428766e..41ba43fc 100644 --- a/plugins/page/classes/modules/page/mapper/Page.mapper.class.php +++ b/plugins/page/classes/modules/page/mapper/Page.mapper.class.php @@ -29,11 +29,12 @@ class PluginPage_ModulePage_MapperPage extends Mapper { page_seo_description, page_active, page_main, - page_sort + page_sort, + page_auto_br ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?d, ?d, ?d) "; - if ($iId=$this->oDb->query($sql,$oPage->getPid(),$oPage->getUrl(),$oPage->getUrlFull(),$oPage->getTitle(),$oPage->getText(),$oPage->getDateAdd(),$oPage->getSeoKeywords(),$oPage->getSeoDescription(),$oPage->getActive(),$oPage->getMain(),$oPage->getSort())) + if ($iId=$this->oDb->query($sql,$oPage->getPid(),$oPage->getUrl(),$oPage->getUrlFull(),$oPage->getTitle(),$oPage->getText(),$oPage->getDateAdd(),$oPage->getSeoKeywords(),$oPage->getSeoDescription(),$oPage->getActive(),$oPage->getMain(),$oPage->getSort(),$oPage->getAutoBr())) { return $iId; } @@ -52,10 +53,11 @@ class PluginPage_ModulePage_MapperPage extends Mapper { page_seo_description = ? , page_active = ?, page_main = ?, - page_sort = ? + page_sort = ?, + page_auto_br = ? WHERE page_id = ?d "; - if ($this->oDb->query($sql,$oPage->getPid(),$oPage->getUrl(),$oPage->getUrlFull(),$oPage->getTitle(),$oPage->getText(),$oPage->getDateEdit(),$oPage->getSeoKeywords(),$oPage->getSeoDescription(),$oPage->getActive(),$oPage->getMain(),$oPage->getSort(),$oPage->getId())) + if ($this->oDb->query($sql,$oPage->getPid(),$oPage->getUrl(),$oPage->getUrlFull(),$oPage->getTitle(),$oPage->getText(),$oPage->getDateEdit(),$oPage->getSeoKeywords(),$oPage->getSeoDescription(),$oPage->getActive(),$oPage->getMain(),$oPage->getSort(),$oPage->getAutoBr(),$oPage->getId())) { return true; } diff --git a/plugins/page/dump.sql b/plugins/page/dump.sql index e1d7ad8e..a9d5fbf6 100644 --- a/plugins/page/dump.sql +++ b/plugins/page/dump.sql @@ -12,6 +12,7 @@ CREATE TABLE IF NOT EXISTS `prefix_page` ( `page_active` tinyint(1) unsigned NOT NULL DEFAULT '1', `page_main` tinyint(1) unsigned NOT NULL DEFAULT '0', `page_sort` int(11) NOT NULL, + `page_auto_br` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`page_id`), KEY `page_pid` (`page_pid`), KEY `page_url_full` (`page_url_full`,`page_active`), @@ -21,5 +22,5 @@ CREATE TABLE IF NOT EXISTS `prefix_page` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -INSERT INTO `prefix_page` (`page_id`, `page_pid`, `page_url`, `page_url_full`, `page_title`, `page_text`, `page_date_add`, `page_date_edit`, `page_seo_keywords`, `page_seo_description`, `page_active`, `page_main`, `page_sort`) VALUES -(1, NULL, 'about', 'about', 'about', 'edit this page http://yousite/page/admin/', '2010-06-06 02:29:28', NULL, '', '', 1, 1, 1); \ No newline at end of file +INSERT INTO `prefix_page` (`page_id`, `page_pid`, `page_url`, `page_url_full`, `page_title`, `page_text`, `page_date_add`, `page_date_edit`, `page_seo_keywords`, `page_seo_description`, `page_active`, `page_main`, `page_sort`, `page_auto_br`) VALUES +(1, NULL, 'about', 'about', 'about', 'edit this page http://yousite/page/admin/', '2010-06-06 02:29:28', NULL, '', '', 1, 1, 1, 1); \ No newline at end of file diff --git a/plugins/page/dump_update_1.2.1_to_1.3.sql b/plugins/page/dump_update_1.2.1_to_1.3.sql new file mode 100644 index 00000000..ed35f59b --- /dev/null +++ b/plugins/page/dump_update_1.2.1_to_1.3.sql @@ -0,0 +1 @@ +ALTER TABLE `prefix_page` ADD `page_auto_br` TINYINT( 1 ) NOT NULL DEFAULT '1'; \ No newline at end of file diff --git a/plugins/page/plugin.xml b/plugins/page/plugin.xml index 9f54af0c..a891d941 100644 --- a/plugins/page/plugin.xml +++ b/plugins/page/plugin.xml @@ -7,9 +7,9 @@ LiveStreet Developers Team http://livestreet.ru - 1.2.1 + 1.3.0 - 0.4.1 + 0.4.2 diff --git a/plugins/page/templates/language/english.php b/plugins/page/templates/language/english.php index 08cf41da..5b72dd8f 100644 --- a/plugins/page/templates/language/english.php +++ b/plugins/page/templates/language/english.php @@ -46,6 +46,7 @@ return array( 'page_create_sort_notice' => 'Sets the sorting when displaying', 'page_create_sort_error' => 'Sorting must be a number', 'page_create_active' => 'Show active page', + 'page_create_auto_br' => 'auto BR (new line)', 'page_create_main' => 'display on the main page', 'page_create_submit_save' => 'Save', 'page_create_submit_save_ok' => 'New page has been created', diff --git a/plugins/page/templates/language/russian.php b/plugins/page/templates/language/russian.php index 5522d020..6051b1a1 100644 --- a/plugins/page/templates/language/russian.php +++ b/plugins/page/templates/language/russian.php @@ -46,6 +46,7 @@ return array( 'page_create_sort_notice' => 'Устанавливает сортировку при отображении', 'page_create_sort_error' => 'Сортировка должна быть числом', 'page_create_active' => 'показывать страницу', + 'page_create_auto_br' => 'автоматические переносы строк', 'page_create_main' => 'отображать на главной странице', 'page_create_submit_save' => 'сохранить', 'page_create_submit_save_ok' => 'Новая страница добавлена', diff --git a/plugins/page/templates/skin/default/actions/ActionPage/add.tpl b/plugins/page/templates/skin/default/actions/ActionPage/add.tpl index 4f60781c..b8b1e3be 100644 --- a/plugins/page/templates/skin/default/actions/ActionPage/add.tpl +++ b/plugins/page/templates/skin/default/actions/ActionPage/add.tpl @@ -83,6 +83,8 @@ {$aLang.page_create_sort_notice}

+

+

diff --git a/plugins/page/templates/skin/default/actions/ActionPage/page.tpl b/plugins/page/templates/skin/default/actions/ActionPage/page.tpl index 082769a5..b10af47d 100644 --- a/plugins/page/templates/skin/default/actions/ActionPage/page.tpl +++ b/plugins/page/templates/skin/default/actions/ActionPage/page.tpl @@ -6,7 +6,11 @@ {if $oConfig->GetValue('view.tinymce')} {$oPage->getText()} {else} - {$oPage->getText()|nl2br} + {if $oPage->getAutoBr()} + {$oPage->getText()|nl2br} + {else} + {$oPage->getText()} + {/if} {/if} diff --git a/plugins/page/templates/skin/new/actions/ActionPage/add.tpl b/plugins/page/templates/skin/new/actions/ActionPage/add.tpl index 0cb746b6..020fecf4 100644 --- a/plugins/page/templates/skin/new/actions/ActionPage/add.tpl +++ b/plugins/page/templates/skin/new/actions/ActionPage/add.tpl @@ -83,6 +83,10 @@ tinyMCE.init({ {$aLang.page_create_sort_notice}

+

+ +

+

diff --git a/plugins/page/templates/skin/new/actions/ActionPage/page.tpl b/plugins/page/templates/skin/new/actions/ActionPage/page.tpl index 558b1b38..874e1089 100644 --- a/plugins/page/templates/skin/new/actions/ActionPage/page.tpl +++ b/plugins/page/templates/skin/new/actions/ActionPage/page.tpl @@ -6,7 +6,11 @@ {if $oConfig->GetValue('view.tinymce')} {$oPage->getText()} {else} - {$oPage->getText()|nl2br} + {if $oPage->getAutoBr()} + {$oPage->getText()|nl2br} + {else} + {$oPage->getText()} + {/if} {/if}