mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 05:55:02 +03:00
Ticket #106 Доработки плагина "page"
This commit is contained in:
parent
3ca87c2d5d
commit
de5c7a40c3
|
@ -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) {
|
||||
|
|
|
@ -56,6 +56,9 @@ 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;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
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);
|
1
plugins/page/dump_update_1.2.1_to_1.3.sql
Normal file
1
plugins/page/dump_update_1.2.1_to_1.3.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `prefix_page` ADD `page_auto_br` TINYINT( 1 ) NOT NULL DEFAULT '1';
|
|
@ -7,9 +7,9 @@
|
|||
<lang name="default">LiveStreet Developers Team</lang>
|
||||
</author>
|
||||
<homepage>http://livestreet.ru</homepage>
|
||||
<version>1.2.1</version>
|
||||
<version>1.3.0</version>
|
||||
<requires>
|
||||
<livestreet>0.4.1</livestreet>
|
||||
<livestreet>0.4.2</livestreet>
|
||||
<plugins>
|
||||
</plugins>
|
||||
</requires>
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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' => 'Новая страница добавлена',
|
||||
|
|
|
@ -83,6 +83,8 @@
|
|||
<input type="text" id="page_sort" name="page_sort" value="{$_aRequest.page_sort}" class="input-wide" />
|
||||
<span class="note">{$aLang.page_create_sort_notice}</span></p>
|
||||
|
||||
<p><label><input type="checkbox" id="page_auto_br" name="page_auto_br" value="1" class="checkbox" {if $_aRequest.page_auto_br==1}checked{/if}/>{$aLang.page_create_auto_br}</label></p>
|
||||
|
||||
<p><label><input type="checkbox" id="page_active" name="page_active" value="1" class="checkbox" {if $_aRequest.page_active==1}checked{/if} />{$aLang.page_create_active}</label></p>
|
||||
|
||||
<p><label><input type="checkbox" id="page_main" name="page_main" value="1" class="checkbox" {if $_aRequest.page_main==1}checked{/if} />{$aLang.page_create_main}</label></p>
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
{if $oConfig->GetValue('view.tinymce')}
|
||||
{$oPage->getText()}
|
||||
{else}
|
||||
{if $oPage->getAutoBr()}
|
||||
{$oPage->getText()|nl2br}
|
||||
{else}
|
||||
{$oPage->getText()}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -83,6 +83,10 @@ tinyMCE.init({
|
|||
<input type="text" id="page_sort" name="page_sort" value="{$_aRequest.page_sort}" class="w100p" />
|
||||
<span class="form_note">{$aLang.page_create_sort_notice}</span></p>
|
||||
|
||||
<p><input type="checkbox" id="page_auto_br" name="page_auto_br" value="1" {if $_aRequest.page_auto_br==1}checked{/if}/>
|
||||
<label for="page_auto_br"> — {$aLang.page_create_auto_br}</label>
|
||||
</p>
|
||||
|
||||
<p><input type="checkbox" id="page_active" name="page_active" value="1" {if $_aRequest.page_active==1}checked{/if}/>
|
||||
<label for="page_active"> — {$aLang.page_create_active}</label>
|
||||
</p>
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
{if $oConfig->GetValue('view.tinymce')}
|
||||
{$oPage->getText()}
|
||||
{else}
|
||||
{if $oPage->getAutoBr()}
|
||||
{$oPage->getText()|nl2br}
|
||||
{else}
|
||||
{$oPage->getText()}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue