Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

RomanL 6 лет назад
Родитель
Сommit
579860debc

+ 21 - 0
modules/boonex/decorous/data/template/system/scripts/BxTemplPageWiki.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaTemplate UNA Template Classes
+ * @{
+ */
+
+/**
+ * @see BxBasePageWiki
+ */
+class BxTemplPageWiki extends BxBasePageWiki
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/lucid/data/template/system/scripts/BxTemplPageWiki.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaTemplate UNA Template Classes
+ * @{
+ */
+
+/**
+ * @see BxBasePageWiki
+ */
+class BxTemplPageWiki extends BxBasePageWiki
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/ocean/data/template/system/scripts/BxTemplPageWiki.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaTemplate UNA Template Classes
+ * @{
+ */
+
+/**
+ * @see BxBasePageWiki
+ */
+class BxTemplPageWiki extends BxBasePageWiki
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/protean/data/template/system/scripts/BxTemplPageWiki.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaTemplate UNA Template Classes
+ * @{
+ */
+
+/**
+ * @see BxBasePageWiki
+ */
+class BxTemplPageWiki extends BxBasePageWiki
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 1 - 1
modules/boonex/wiki/install/sql/enable.sql

@@ -24,4 +24,4 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 
 SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('sys_homepage', 'bx_wiki', 'wiki-home', '', '_bx_wiki_menu_item_title_system_home', 'r.php?_q=wiki/wiki-home', '', '', 'far wikipedia-w', '', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+('sys_homepage', 'bx_wiki', 'wiki-home', '', '_bx_wiki_menu_item_title_system_home', 'r.php?_q=wiki/wiki-home', '', '', 'fab wikipedia-w', '', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);

+ 1 - 1
modules/boonex/wiki/install/sql/install.sql

@@ -2,7 +2,7 @@
 -- Wiki home page
 
 INSERT INTO `sys_objects_page` (`object`, `uri`, `title_system`, `title`, `module`, `cover`, `cover_image`, `type_id`, `layout_id`, `submenu`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
-('bx_wiki_home', 'wiki-home', '', '_bx_wiki_page_home', 'bx_wiki', 0, 0, 1, 5, '', 2147483647, 1, 'r.php?_q=wiki/home', '', '', '', 0, 1, 0, '', '');
+('bx_wiki_home', 'wiki-home', '', '_bx_wiki_page_home', 'bx_wiki', 0, 0, 1, 5, '', 2147483647, 1, 'r.php?_q=wiki/home', '', '', '', 0, 1, 0, 'BxTemplPageWiki', '');
 
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `hidden_on`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
 ('bx_wiki_home', 1, 'bx_wiki', '', '_bx_wiki_block_home', 0, 2147483647, '0', 'wiki', '', 0, 1, 1, 1);

+ 12 - 2
template/scripts/BxBasePage.php

@@ -213,10 +213,10 @@ class BxBasePage extends BxDolPage
     }
 
     /**
-     * Get page code only.
+     * Get page code vars
      * @return string
      */
-    protected function _getPageCode ()
+    protected function _getPageCodeVars ()
     {
     	$aHiddenOn = array(
             pow(2, BX_DB_HIDDEN_PHONE - 1) => 'bx-def-media-phone-hide',
@@ -246,6 +246,16 @@ class BxBasePage extends BxDolPage
             $aVars[$sKey] = $sCell;
         }
 
+        return $aVars;
+    }
+
+    /**
+     * Get page code only.
+     * @return string
+     */
+    protected function _getPageCode ()
+    {
+        $aVars = $this->_getPageCodeVars ();
         return $this->_oTemplate->parseHtmlByName($this->_aObject['template'], $aVars);
     }
 

+ 36 - 0
template/scripts/BxBasePageWiki.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaBaseView UNA Base Representation Classes
+ * @{
+ */
+
+/**
+ * Wiki page
+ */
+class BxBasePageWiki extends BxTemplPage
+{
+    public function __construct($aObject, $oTemplate)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _getPageCodeVars ()
+    {
+        $aVars = parent::_getPageCodeVars ();
+        
+        $oWiki = BxDolWiki::getObjectInstance($this->_aObject['module']);
+        if ($oWiki->isAllowed('add')) {
+            foreach ($aVars as $sKey => $sCell) {
+                if (0 !== strncmp('cell_', $sKey, 5))
+                    continue;
+                $aVars[$sKey] = $sCell . '<div class="bx-def-margin-top bx-def-padding" style="border:1px dashed #aaa; text-align:center;"><a href="javascript:void(0);" onclick="alert(\'TODO: wiki block add form\')"><i class="sys-icon plus"></i> Add Block</a></div>';
+            }
+        }
+        return $aVars;
+    }
+}
+
+/** @} */

+ 1 - 1
template/scripts/BxBaseServiceWiki.php

@@ -52,7 +52,7 @@ class BxBaseServiceWiki extends BxDol
                     $oTemplate = BxDolTemplate::getInstance();
                     $oTemplate->displayErrorOccured(_t("_sys_wiki_error_page_exists", bx_process_output($sUri)));
                 } else {
-                    echo "TODO: wiki - suggest to create page with specified URI. Display form where user can enter title(text input), text(plain textrea), languale (select with currect site languages with current one pre-selected), title - will be page and first block title, text - will be content for first block. Default layout is page with one column and block without borders and title.";
+                    echo "TODO: wiki - suggest to create page with specified URI. Display form where user can enter title(text input), text(plain textrea), languale (selectbox with currect site languages with current one pre-selected), revision comments (text input), title - will be page and first block title, text - will be content for first block. Default layout is page with one column and block without borders and title.";
                 }
             } 
             else {