Procházet zdrojové kódy

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

AntonLV před 6 roky
rodič
revize
ae725bdcbe

+ 3 - 11
install/sql/system.sql

@@ -1512,8 +1512,7 @@ CREATE TABLE `sys_permalinks` (
 INSERT INTO `sys_permalinks` (`standard`, `permalink`, `check`, `compare_by_prefix`) VALUES
 ('page.php?i=', 'page/', 'permalinks_pages', 1),
 ('modules/?r=', 'm/', 'permalinks_modules', 1),
-('storage.php?o=', 's/', 'permalinks_storage', 1),
-('r.php?_q=wiki/', 'wiki/', 'permalinks_pages', 1);
+('storage.php?o=', 's/', 'permalinks_storage', 1);
 
 
 -- --------------------------------------------------------
@@ -4837,15 +4836,11 @@ CREATE TABLE IF NOT EXISTS `sys_objects_wiki` (
   `allow_edit_for_levels` int(11) NOT NULL DEFAULT '2147483647',
   `allow_delete_for_levels` int(11) NOT NULL DEFAULT '2147483647',
   `allow_translate_for_levels` int(11) NOT NULL DEFAULT '2147483647',
+  `allow_unsafe_for_levels` int(11) NOT NULL DEFAULT '2147483647',
   `override_class_name` varchar(255) NOT NULL,
   `override_class_file` varchar(255) NOT NULL
 );
 
-INSERT INTO `sys_objects_wiki` (`object`, `title`, `module`, `allow_add_for_levels`, `allow_edit_for_levels`, `allow_delete_for_levels`, `allow_translate_for_levels`, `override_class_name`, `override_class_file`) VALUES
-('wiki', '_sys_wiki_system_title', 'system', 192, 192, 192, 192, '', '');
-
-
-
 CREATE TABLE IF NOT EXISTS `sys_pages_wiki_blocks` (
   `id` int(10) UNSIGNED NOT NULL,
   `block_id` int(11) NOT NULL,
@@ -4871,9 +4866,6 @@ CREATE TABLE IF NOT EXISTS `sys_rewrite_rules` (
   `active` tinyint(4) NOT NULL DEFAULT '1'
 );
 
-INSERT INTO `sys_rewrite_rules` (`preg`, `service`, `active`) VALUES
-('^wiki/(.*)$', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:9:"wiki_page";s:6:"params";a:2:{i:0;s:4:"wiki";i:1;s:3:"{1}";}s:5:"class";s:16:"TemplServiceWiki";}', 1);
-
 -- --------------------------------------------------------
 
 --
@@ -5127,4 +5119,4 @@ INSERT INTO `sys_std_pages_widgets`(`page_id`, `widget_id`, `order`) VALUES(@iId
 --
 INSERT INTO `sys_std_widgets`(`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
 (@iIdBadges, 'system', '{url_studio}badges.php', '', 'wi-badges.svg', '_adm_wgt_cpt_badges', '', '');
-INSERT INTO `sys_std_pages_widgets`(`page_id`, `widget_id`, `order`) VALUES(@iIdHome, LAST_INSERT_ID(), 11);
+INSERT INTO `sys_std_pages_widgets`(`page_id`, `widget_id`, `order`) VALUES(@iIdHome, LAST_INSERT_ID(), 11);

+ 20 - 0
modules/boonex/wiki/classes/BxWikiConfig.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWikiConfig extends BxDolModuleConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/wiki/classes/BxWikiDb.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWikiDb extends BxDolModuleDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/wiki/classes/BxWikiModule.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWikiModule extends BxDolModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/wiki/classes/BxWikiStudioPage.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWikiStudioPage extends BxTemplStudioModule
+{
+    function __construct($sModule = "", $sPage = "")
+    {
+        parent::__construct($sModule, $sPage);
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/wiki/classes/BxWikiTemplate.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWikiTemplate extends BxDolModuleTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+}
+
+/** @} */

+ 75 - 0
modules/boonex/wiki/install/config.php

@@ -0,0 +1,75 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_wiki',
+    'title' => 'Wiki',
+    'note' => 'Wiki.',
+    'version' => '10.0.0.DEV',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '10.1.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/wiki/',
+    'home_uri' => 'wiki',
+
+    'db_prefix' => 'bx_wiki_',
+    'class_prefix' => 'BxWiki',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Wiki',
+
+	/**
+     * Storage objects to automatically delete files from upon module uninstallation.
+     * Note. Don't add storage objects used in transcoder objects.
+     */
+    'storages' => array(
+    ),
+    
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+);
+
+/** @} */

+ 20 - 0
modules/boonex/wiki/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxWikiInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 5 - 0
modules/boonex/wiki/install/langs/en.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+    <string name="_sys_module_wiki"><![CDATA[Wiki]]></string>
+    <string name="_bx_wiki"><![CDATA[Wiki]]></string>
+</resources>

+ 13 - 0
modules/boonex/wiki/install/sql/disable.sql

@@ -0,0 +1,13 @@
+
+-- Wiki object
+
+DELETE FROM `sys_objects_wiki` WHERE `object` = 'bx_wiki';
+
+-- Permalinks
+
+DELETE FROM `sys_permalinks` WHERE `standard` = 'r.php?_q=wiki/' AND `permalink` = 'wiki/';
+
+-- Rewrite rules
+
+DELETE FROM `sys_rewrite_rules` WHERE `preg` = '^wiki/(.*)$';
+

+ 16 - 0
modules/boonex/wiki/install/sql/enable.sql

@@ -0,0 +1,16 @@
+
+-- Wiki object
+
+INSERT INTO `sys_objects_wiki` (`object`, `title`, `module`, `allow_add_for_levels`, `allow_edit_for_levels`, `allow_delete_for_levels`, `allow_translate_for_levels`, `allow_unsafe_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_wiki', '_sys_wiki_system_title', 'system', 192, 192, 192, 192, 192, '', '');
+
+-- Permalinks
+
+INSERT INTO `sys_permalinks` (`standard`, `permalink`, `check`, `compare_by_prefix`) VALUES
+('r.php?_q=wiki/', 'wiki/', 'permalinks_pages', 1);
+
+-- Rewrite rules
+
+INSERT INTO `sys_rewrite_rules` (`preg`, `service`, `active`) VALUES
+('^wiki/(.*)$', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:9:"wiki_page";s:6:"params";a:2:{i:0;s:4:"wiki";i:1;s:3:"{1}";}s:5:"class";s:16:"TemplServiceWiki";}', 1);
+

+ 14 - 0
modules/boonex/wiki/install/sql/install.sql

@@ -0,0 +1,14 @@
+
+-- Studio page and widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_wiki', '_bx_wiki', '_bx_wiki', 'bx_wiki@modules/boonex/wiki/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_wiki', '{url_studio}module.php?name=bx_wiki', '', 'bx_wiki@modules/boonex/wiki/|std-icon.svg', '_bx_wiki', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 9 - 0
modules/boonex/wiki/install/sql/uninstall.sql

@@ -0,0 +1,9 @@
+
+
+
+-- Studio page and widget
+
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_wiki';
+

+ 20 - 0
modules/boonex/wiki/request.php

@@ -0,0 +1,20 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Wiki Wiki
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+check_logged();
+
+if ( empty($aRequest) || empty($aRequest[0]) ) {
+    BxDolRequest::processAsFile($aModule, $aRequest);
+} else {
+    BxDolRequest::processAsAction($aModule, $aRequest);
+}
+
+/** @} */

+ 14 - 0
modules/boonex/wiki/template/css/editor.css

@@ -0,0 +1,14 @@
+.fr-popup {
+    z-index:1100 !important;
+}
+
+.fr-view pre {
+    /* NOTE: this style was copied to editor.css */
+    padding: 5px;
+    border: 1px solid green;
+    background-color: white;
+    color: #009900;
+    display: block;
+    margin: 0;
+    overflow-x: auto;
+}

+ 25 - 0
modules/boonex/wiki/template/images/icons/std-icon.svg

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="606px" height="606px" viewBox="0 0 606 606" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <defs>
+        <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
+            <stop stop-color="#4f9865" stop-opacity="1" offset="0%"></stop>
+            <stop stop-color="#1c6935" stop-opacity="1" offset="100%"></stop>
+        </linearGradient>
+        <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 Z" id="path-2"></path>
+    </defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="una-connect" transform="translate(3.000000, 3.000000)">
+            <g id="Squircle2-Copy-6">
+                <g id="Shape">
+                    <use fill="#FFFFFF" xlink:href="#path-2"></use>
+                    <use stroke="#000000" stroke-width="4.04" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
+                </g>
+            </g>
+            <g>
+                <text x="50%" y="58%" style="text-anchor: middle; fill: #ffffff; stroke: #000000; font-size: 180px;">
+                    WIKI
+                </text>
+            </g>
+        </g>
+    </g>
+</svg>