|
From: <be...@us...> - 2014-04-25 11:35:59
|
Revision: 12475
http://sourceforge.net/p/xoops/svn/12475
Author: beckmi
Date: 2014-04-25 11:35:52 +0000 (Fri, 25 Apr 2014)
Log Message:
-----------
XOOPS 2.5.7 Module Pack update (work in progress): Boox
Modified Paths:
--------------
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/about.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_footer.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_header.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/index.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/main.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/menu.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/class/storage.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/docs/changelog.txt
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/include/functions.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/admin.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/modinfo.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/xoops_version.php
Added Paths:
-----------
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/boox_logo.png
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/delete.gif
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/edit.gif
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/index.html
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/index.html
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/index.html
Removed Paths:
-------------
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/images/
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english_ISO/
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/french/
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/french_ISO/
XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/portuguesebr_ISO/
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/about.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/about.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/about.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -1,32 +1,32 @@
-<?php
-/**
- * ****************************************************************************
- * boox - MODULE FOR XOOPS
- * Copyright (c) Hervé Thouzard (http://www.herve-thouzard.com)
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright Hervé Thouzard (http://www.herve-thouzard.com)
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
- * @package boox
- * @author Hervé Thouzard (http://www.herve-thouzard.com)
- *
- * Version : $Id:
- * ****************************************************************************
- */
-
-include_once dirname(__FILE__) . '/admin_header.php';
-
-xoops_cp_header();
-
-$aboutAdmin = new ModuleAdmin();
-
-echo $aboutAdmin->addNavigation('about.php');
-echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-
-include 'admin_footer.php';
\ No newline at end of file
+<?php
+/**
+ * ****************************************************************************
+ * boox - MODULE FOR XOOPS
+ * Copyright (c) Hervé Thouzard (http://www.herve-thouzard.com)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright Hervé Thouzard (http://www.herve-thouzard.com)
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
+ * @package boox
+ * @author Hervé Thouzard (http://www.herve-thouzard.com)
+ *
+ * Version : $Id:
+ * ****************************************************************************
+ */
+
+include_once dirname(__FILE__) . '/admin_header.php';
+
+xoops_cp_header();
+
+$aboutAdmin = new ModuleAdmin();
+
+echo $aboutAdmin->addNavigation('about.php');
+echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
+
+include 'admin_footer.php';
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_footer.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_footer.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_footer.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -20,8 +20,6 @@
* ****************************************************************************
*/
-
-
echo "<div class='adminfooter'>\n"
." <div style='text-align: center;'>\n"
." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
@@ -29,4 +27,4 @@
." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
."</div>";
-xoops_cp_footer();
\ No newline at end of file
+xoops_cp_footer();
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_header.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_header.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/admin_header.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -1,48 +1,47 @@
-<?php
-/**
- * ****************************************************************************
- * boox - MODULE FOR XOOPS
- * Copyright (c) Herv� Thouzard (http://www.herve-thouzard.com)
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright Herv� Thouzard (http://www.herve-thouzard.com)
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
- * @package boox
- * @author Herv� Thouzard (http://www.herve-thouzard.com)
- *
- * Version : $Id:
- * ****************************************************************************
- */
-
-$path = dirname(dirname(dirname(dirname(__FILE__))));
-include_once $path . '/mainfile.php';
-include_once $path . '/include/cp_functions.php';
-require_once $path . '/include/cp_header.php';
-
-global $xoopsModule;
-
-$thisModDir = $GLOBALS['xoopsModule']->getVar('dirname');
-
-require_once dirname(dirname(__FILE__)) . '/include/functions.php';
-
-// Load language files
-xoops_loadLanguage('admin', $thisModDir);
-xoops_loadLanguage('modinfo', $thisModDir);
-xoops_loadLanguage('main', $thisModDir);
-
-$pathIcon16 = '../'.$xoopsModule->getInfo('icons16');
-$pathIcon32 = '../'.$xoopsModule->getInfo('icons32');
-$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
-
-if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
- include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
- }else{
- redirect_header("../../../admin.php", 5, _AM_BOOX_MODULEADMIN_MISSING, false);
- }
-
+<?php
+/**
+ * ****************************************************************************
+ * boox - MODULE FOR XOOPS
+ * Copyright (c) Herv� Thouzard (http://www.herve-thouzard.com)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright Herv� Thouzard (http://www.herve-thouzard.com)
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
+ * @package boox
+ * @author Herv� Thouzard (http://www.herve-thouzard.com)
+ *
+ * Version : $Id:
+ * ****************************************************************************
+ */
+
+$path = dirname(dirname(dirname(dirname(__FILE__))));
+include_once $path . '/mainfile.php';
+include_once $path . '/include/cp_functions.php';
+require_once $path . '/include/cp_header.php';
+
+global $xoopsModule;
+
+$thisModDir = $GLOBALS['xoopsModule']->getVar('dirname');
+
+require_once dirname(dirname(__FILE__)) . '/include/functions.php';
+
+// Load language files
+xoops_loadLanguage('admin', $thisModDir);
+xoops_loadLanguage('modinfo', $thisModDir);
+xoops_loadLanguage('main', $thisModDir);
+
+$pathIcon16 = '../'.$xoopsModule->getInfo('icons16');
+$pathIcon32 = '../'.$xoopsModule->getInfo('icons32');
+$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))) {
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+ } else {
+ redirect_header("../../../admin.php", 5, _AM_BOOX_MODULEADMIN_MISSING, false);
+ }
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/index.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/index.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/index.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -1,34 +1,33 @@
-<?php
-/**
- * ****************************************************************************
- * boox - MODULE FOR XOOPS
- * Copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
- * @package boox
- * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- *
- * Version : $Id:
- * ****************************************************************************
- */
-
-
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
-include_once dirname(__FILE__) . '/admin_header.php';
-
-xoops_cp_header();
-
- $indexAdmin = new ModuleAdmin();
-
- echo $indexAdmin->addNavigation('index.php');
- echo $indexAdmin->renderIndex();
-
-include "admin_footer.php";
\ No newline at end of file
+<?php
+/**
+ * ****************************************************************************
+ * boox - MODULE FOR XOOPS
+ * Copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
+ * @package boox
+ * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ *
+ * Version : $Id:
+ * ****************************************************************************
+ */
+
+require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
+
+xoops_cp_header();
+
+ $indexAdmin = new ModuleAdmin();
+
+ echo $indexAdmin->addNavigation('index.php');
+ echo $indexAdmin->renderIndex();
+
+include 'admin_footer.php';
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/main.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/main.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/main.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -1,175 +1,174 @@
-<?php
-/**
- * ****************************************************************************
- * boox - MODULE FOR XOOPS
- * Copyright (c) Herv� Thouzard (http://www.herve-thouzard.com)
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright Herv� Thouzard (http://www.herve-thouzard.com)
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
- * @package boox
- * @author Herv� Thouzard (http://www.herve-thouzard.com)
- *
- * Version : $Id:
- * ****************************************************************************
- */
-
-require_once '../../../include/cp_header.php';
-require_once XOOPS_ROOT_PATH.'/modules/boox/include/functions.php';
-require_once XOOPS_ROOT_PATH.'/modules/boox/class/storage.php';
-include_once 'admin_header.php';
-
-$indexAdmin = new ModuleAdmin();
-
-// ********************************************************************************************************************
-// **** Main
-// ********************************************************************************************************************
-$op = 'default';
-if(isset($_POST['op'])) {
- $op=$_POST['op'];
-} elseif(isset($_GET['op'])) {
- $op=$_GET['op'];
-}
-$storage = new boox_storage();
-
-function edit_file_content($content='', $filename='')
-{
- require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
- $sform = new XoopsThemeForm(_AM_BOOX_FILE, 'ffile', XOOPS_URL.'/modules/boox/admin/main.php', 'post');
- if(xoops_trim($filename) != '') {
- $sform->addElement(new XoopsFormHidden('filename', $filename), false);
- } else {
- $sform->addElement(new XoopsFormText(_AM_BOOX_FILENAME, 'filename', 50, 255, $filename), true);
- $sform->addElement(new XoopsFormHidden('newfile', '1'), false);
- }
- $sform->addElement(new XoopsFormHidden('op', 'save'), false);
- $editor = boox_getWysiwygForm(_AM_BOOX_CONTENT, 'file_content', $content, 15, 60, 'content_hidden');
- if($editor) {
- $sform->addElement($editor,false);
- }
- $button_tray = new XoopsFormElementTray('' ,'');
- $submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');
- $button_tray->addElement($submit_btn);
- $sform->addElement($button_tray);
- $sform->display();
-}
-
-
-
-switch ($op) {
- case 'addfile': // Add a new file
- xoops_cp_header();
- echo $indexAdmin->addNavigation('main.php');
- edit_file_content();
- break;
-
- case 'save': // Save a file after it was edited (or created)
- $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
- if(!isset($_POST['filename'])) {
- redirect_header( 'main.php', 3, _AM_BOOX_ERROR1);
- }
-
- if(substr($folder_storage,-1,1) != '/') {
- $folder_storage .= '/';
- }
- $filename = $_POST['filename'];
- $content = $_POST['file_content'];
- if (get_magic_quotes_gpc()) {
- $content = stripslashes($content);
- }
- if(boox_getmoduleoption('trimcontent')) {
- $content = xoops_trim($content);
- }
- $fp = fopen($folder_storage.$filename,'w') or die(_AM_BOOX_ERROR1);
- fwrite($fp,$content);
- fclose($fp);
- if(isset($_POST['newfile'])) {
- $storage->getAllFiles();
- $storage->addfiles($filename);
- $storage->store();
- }
- redirect_header('main.php',2,_AM_BOOX_DBUPDATED);
- break;
-
-
- case 'edit':
- xoops_cp_header();
- echo $indexAdmin->addNavigation('main.php');
- if(!isset($_GET['filename'])) {
- redirect_header( 'main.php', 3, _AM_BOOX_ERROR1);
- }
- $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
- if(substr($folder_storage,-1,1) != '/') {
- $folder_storage .= '/';
- }
- $filename = $_GET['filename'];
- $fp = fopen($folder_storage.$filename,'r') or die(sprintf(_AM_BOOX_ERROR3,$filename));
- $content = fread($fp, filesize($folder_storage.$filename));
- fclose($fp);
- edit_file_content($content, $filename);
- break;
-
-
- case 'delete': // Delete a file
- if(!isset($_GET['filename'])) {
- redirect_header( 'main.php', 3, _AM_BOOX_ERROR1);
- }
- $filename = $_GET['filename'];
- $storage->getAllFiles();
- $storage->delete($filename);
- $storage->store();
- $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
- if(substr($folder_storage,-1,1) != '/') {
- $folder_storage .= '/';
- }
- @unlink($folder_storage.$filename);
- redirect_header('main.php',2,_AM_BOOX_DBUPDATED);
- break;
-
-
- default: // Default action, list existing files
- $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
- if(substr($folder_storage,-1,1) != '/') {
- $folder_storage .= '/';
- }
- xoops_cp_header();
- echo $indexAdmin->addNavigation('main.php');
- $indexAdmin->addItemButton(_ADD, 'main.php?op=addfile', 'add', '');
- echo $indexAdmin->renderButton('right', '');
-
- echo '<h4>'._AM_BOOX_FILES.'</h4>';
- $files = array();
- $files = $storage->getAllFiles();
- echo '<table border="0" align="center" width="95%">';
- echo '<tr>';
- echo '<th align="center">'._AM_BOOX_FILE.'</th>';
- echo '<th align="center">'._AM_BOOX_COMMAND.'</th>';
- echo '<th align="center">'._AM_BOOX_ACTION.'</th>';
- echo '</tr>';
- $class='';
- foreach($files as $file) {
- $class = ($class == 'even') ? 'odd' : 'even';
- $action_edit = '<a title="'._EDIT.'" href="main.php?op=edit&filename='.urlencode($file).'"><img border="0" src="../images/edit.gif" /></a>';
- $action_delete = '<a '.boox_JavascriptLinkConfirm(_AM_BOOX_CONFIRM).' title="'._DELETE.'" href="main.php?op=delete&filename='.urlencode($file).'"><img border="0" src="../images/delete.gif" /></a>';
- $command = "<{php}>include_once '".$folder_storage.$file."';<{/php}>";
- echo "<tr class='".$class."'>";
- echo '<td>'.$file.'</td>';
- echo '<td>'.$command.'</td>';
- echo "<td align='center'>".$action_edit.' '.$action_delete.'</td>';
- echo "</tr>";
- }
- $class = ($class == 'even') ? 'odd' : 'even';
- //echo "<tr class='".$class."'><td colspan='3' align='center'><br /><form method='post' name='fadd' id='fadd' action='main.php'><input type='hidden' name='op' value='addfile' /><input type='submit' name='btngo' value='"._AM_BOOX_ADD."' /></form><br /></td></tr>";
- echo '</table><br/>';
-
- //echo "<br /><div align='center'><a href='http://xoops.instant-zero.com' target='_blank'><img src='../images/instantzero.gif'></a></div>";
- break;
-}
-include "admin_footer.php";
-//xoops_cp_footer();
+<?php
+/**
+ * ****************************************************************************
+ * boox - MODULE FOR XOOPS
+ * Copyright (c) Herv� Thouzard (http://www.herve-thouzard.com)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright Herv� Thouzard (http://www.herve-thouzard.com)
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
+ * @package boox
+ * @author Herv� Thouzard (http://www.herve-thouzard.com)
+ *
+ * Version : $Id:
+ * ****************************************************************************
+ */
+
+require_once '../../../include/cp_header.php';
+require_once XOOPS_ROOT_PATH.'/modules/boox/include/functions.php';
+require_once XOOPS_ROOT_PATH.'/modules/boox/class/storage.php';
+include_once 'admin_header.php';
+
+$indexAdmin = new ModuleAdmin();
+
+// ********************************************************************************************************************
+// **** Main
+// ********************************************************************************************************************
+$op = 'default';
+if (isset($_POST['op'])) {
+ $op=$_POST['op'];
+} elseif (isset($_GET['op'])) {
+ $op=$_GET['op'];
+}
+$storage = new boox_storage();
+
+/**
+ * @param string $content
+ * @param string $filename
+ */
+function edit_file_content($content='', $filename='')
+{
+ require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+ $sform = new XoopsThemeForm(_AM_BOOX_FILE, 'ffile', XOOPS_URL.'/modules/boox/admin/main.php', 'post');
+ if (xoops_trim($filename) != '') {
+ $sform->addElement(new XoopsFormHidden('filename', $filename), false);
+ } else {
+ $sform->addElement(new XoopsFormText(_AM_BOOX_FILENAME, 'filename', 50, 255, $filename), true);
+ $sform->addElement(new XoopsFormHidden('newfile', '1'), false);
+ }
+ $sform->addElement(new XoopsFormHidden('op', 'save'), false);
+ $editor = boox_getWysiwygForm(_AM_BOOX_CONTENT, 'file_content', $content, 15, 60, 'content_hidden');
+ if ($editor) {
+ $sform->addElement($editor,false);
+ }
+ $button_tray = new XoopsFormElementTray('' ,'');
+ $submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');
+ $button_tray->addElement($submit_btn);
+ $sform->addElement($button_tray);
+ $sform->display();
+}
+
+switch ($op) {
+ case 'addfile': // Add a new file
+ xoops_cp_header();
+ echo $indexAdmin->addNavigation('main.php');
+ edit_file_content();
+ break;
+
+ case 'save': // Save a file after it was edited (or created)
+ $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
+ if (!isset($_POST['filename'])) {
+ redirect_header( 'main.php', 3, _AM_BOOX_ERROR1);
+ }
+
+ if (substr($folder_storage,-1,1) != '/') {
+ $folder_storage .= '/';
+ }
+ $filename = $_POST['filename'];
+ $content = $_POST['file_content'];
+ if (get_magic_quotes_gpc()) {
+ $content = stripslashes($content);
+ }
+ if (boox_getmoduleoption('trimcontent')) {
+ $content = xoops_trim($content);
+ }
+ $fp = fopen($folder_storage.$filename,'w') or die(_AM_BOOX_ERROR1);
+ fwrite($fp,$content);
+ fclose($fp);
+ if (isset($_POST['newfile'])) {
+ $storage->getAllFiles();
+ $storage->addfiles($filename);
+ $storage->store();
+ }
+ redirect_header('main.php',2,_AM_BOOX_DBUPDATED);
+ break;
+
+ case 'edit':
+ xoops_cp_header();
+ echo $indexAdmin->addNavigation('main.php');
+ if (!isset($_GET['filename'])) {
+ redirect_header( 'main.php', 3, _AM_BOOX_ERROR1);
+ }
+ $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
+ if (substr($folder_storage,-1,1) != '/') {
+ $folder_storage .= '/';
+ }
+ $filename = $_GET['filename'];
+ $fp = fopen($folder_storage.$filename,'r') or die(sprintf(_AM_BOOX_ERROR3,$filename));
+ $content = fread($fp, filesize($folder_storage.$filename));
+ fclose($fp);
+ edit_file_content($content, $filename);
+ break;
+
+ case 'delete': // Delete a file
+ if (!isset($_GET['filename'])) {
+ redirect_header( 'main.php', 3, _AM_BOOX_ERROR1);
+ }
+ $filename = $_GET['filename'];
+ $storage->getAllFiles();
+ $storage->delete($filename);
+ $storage->store();
+ $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
+ if (substr($folder_storage,-1,1) != '/') {
+ $folder_storage .= '/';
+ }
+ @unlink($folder_storage.$filename);
+ redirect_header('main.php',2,_AM_BOOX_DBUPDATED);
+ break;
+
+ default: // Default action, list existing files
+ $folder_storage = xoops_trim(boox_getmoduleoption('foldertosave'));
+ if (substr($folder_storage,-1,1) != '/') {
+ $folder_storage .= '/';
+ }
+ xoops_cp_header();
+ echo $indexAdmin->addNavigation('main.php');
+ $indexAdmin->addItemButton(_AM_BOOX_ADD, 'main.php?op=addfile', 'add', '');
+ echo $indexAdmin->renderButton('left', '');
+
+ echo '<h4>'._AM_BOOX_FILES.'</h4>';
+ $files = array();
+ $files = $storage->getAllFiles();
+ echo '<table border="0" align="center" width="95%">';
+ echo '<tr>';
+ echo '<th align="center">'._AM_BOOX_FILE.'</th>';
+ echo '<th align="center">'._AM_BOOX_COMMAND.'</th>';
+ echo '<th align="center">'._AM_BOOX_ACTION.'</th>';
+ echo '</tr>';
+ $class='';
+ foreach ($files as $file) {
+ $class = ($class == 'even') ? 'odd' : 'even';
+ $action_edit = '<a title="'._EDIT.'" href="main.php?op=edit&filename='.urlencode($file).'"><img border="0" src="../assets/images/edit.gif" /></a>';
+ $action_delete = '<a '.boox_JavascriptLinkConfirm(_AM_BOOX_CONFIRM).' title="'._DELETE.'" href="main.php?op=delete&filename='.urlencode($file).'"><img border="0" src="../assets/images/delete.gif" /></a>';
+ $command = "<{php}>include_once '".$folder_storage.$file."';<{/php}>";
+ echo "<tr class='".$class."'>";
+ echo '<td>'.$file.'</td>';
+ echo '<td>'.$command.'</td>';
+ echo "<td align='center'>".$action_edit.' '.$action_delete.'</td>';
+ echo "</tr>";
+ }
+ $class = ($class == 'even') ? 'odd' : 'even';
+ //echo "<tr class='".$class."'><td colspan='3' align='center'><br /><form method='post' name='fadd' id='fadd' action='main.php'><input type='hidden' name='op' value='addfile' /><input type='submit' name='btngo' value='"._AM_BOOX_ADD."' /></form><br /></td></tr>";
+ echo '</table><br/>';
+
+ //echo "<br /><div align='center'><a href='http://xoops.instant-zero.com' target='_blank'><img src='../assets/images/instantzero.gif'></a></div>";
+ break;
+}
+include 'admin_footer.php';
+//xoops_cp_footer();
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/menu.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/menu.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/admin/menu.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -34,12 +34,12 @@
$adminmenu[$i]["link"] = 'admin/index.php';
$adminmenu[$i]["icon"] = $pathIcon32.'/home.png';
-$i++;
+++$i;
$adminmenu[$i]["title"] = _MI_BOOX_MENU_01;
$adminmenu[$i]["link"] = 'admin/main.php';
$adminmenu[$i]["icon"] = $pathIcon32.'/manage.png';
-$i++;
+++$i;
$adminmenu[$i]["title"] = _MI_BOOX_ADMIN_ABOUT;
$adminmenu[$i]["link"] = 'admin/about.php';
$adminmenu[$i]["icon"] = $pathIcon32.'/about.png';
Added: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/boox_logo.png
===================================================================
(Binary files differ)
Index: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/boox_logo.png
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/boox_logo.png 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/boox_logo.png 2014-04-25 11:35:52 UTC (rev 12475)
Property changes on: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/boox_logo.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/delete.gif
===================================================================
(Binary files differ)
Index: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/delete.gif
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/delete.gif 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/delete.gif 2014-04-25 11:35:52 UTC (rev 12475)
Property changes on: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/delete.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/edit.gif
===================================================================
(Binary files differ)
Index: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/edit.gif
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/edit.gif 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/edit.gif 2014-04-25 11:35:52 UTC (rev 12475)
Property changes on: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/edit.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/index.html
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/index.html (rev 0)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/images/index.html 2014-04-25 11:35:52 UTC (rev 12475)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/index.html
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/index.html (rev 0)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/assets/index.html 2014-04-25 11:35:52 UTC (rev 12475)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/class/storage.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/class/storage.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/class/storage.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -1,114 +1,114 @@
-<?php
-/**
- * ****************************************************************************
- * boox - MODULE FOR XOOPS
- * Copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
- * @package boox
- * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- *
- * Version : $Id:
- * ****************************************************************************
- */
-
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-class boox_storage
-{
- var $files; // Holds files
- var $filename; // Name of the file wich contains all the other files
-
- function boox_storage()
- {
- $this->filename = XOOPS_UPLOAD_PATH.'/boox_files.php';
- }
-
- /**
- * Get all the files
- */
- function getAllFiles()
- {
- $ret = $tbl_files_list = array();
- $myts =& MyTextSanitizer::getInstance();
- if(file_exists($this->filename)) {
- include_once $this->filename;
- foreach($tbl_files_list as $onefile) {
- if(xoops_trim($onefile)!='') {
- $onefile=$myts->htmlSpecialChars($onefile);
- $ret[$onefile]=$onefile;
- }
- }
- }
- asort($ret);
- $this->files=$ret;
- return $ret;
- }
-
- /**
- * Remove one or many files from the list
- */
- function delete($file)
- {
- if(is_array($file)) {
- foreach($file as $onefile) {
- if(isset($this->files[$onefile])) {
- unset($this->files[$onefile]);
- }
- }
- } else {
- if(isset($this->files[$file])) {
- unset($this->files[$file]);
- }
- }
- }
-
- /**
- * Add one or many Files
- */
- function addfiles($file)
- {
- $myts =& MyTextSanitizer::getInstance();
- if(is_array($file)) {
- foreach($file as $onefile) {
- $onefile=xoops_trim($myts->htmlSpecialChars($onefile));
- $this->files[$onefile]=$onefile;
- }
- } else {
- $file=xoops_trim($myts->htmlSpecialChars($file));
- $this->files[$file]=$file;
- }
-
- }
-
-
- /**
- * Save files
- */
- function store()
- {
- if(file_exists($this->filename)) {
- unlink($this->filename);
- }
- $fd = fopen($this->filename,'w') or die('Error unable to create storage files list');
- fputs($fd,"<?php\n");
- fputs($fd,'$tbl_files_list = array('."\n");
- foreach($this->files as $onefile) {
- fputs($fd,"\"".$onefile."\",\n");
- }
- fputs($fd,"'');\n");
- fputs($fd,"?>\n");
- fclose($fd);
- }
-}
-?>
\ No newline at end of file
+<?php
+/**
+ * ****************************************************************************
+ * boox - MODULE FOR XOOPS
+ * Copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
+ * @package boox
+ * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ *
+ * Version : $Id:
+ * ****************************************************************************
+ */
+
+defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
+
+/**
+ * Class boox_storage
+ */
+class boox_storage
+{
+ var $files; // Holds files
+ var $filename; // Name of the file wich contains all the other files
+
+ function boox_storage()
+ {
+ $this->filename = XOOPS_UPLOAD_PATH.'/boox_files.php';
+ }
+
+ /**
+ * Get all the files
+ */
+ function getAllFiles()
+ {
+ $ret = $tbl_files_list = array();
+ $myts =& MyTextSanitizer::getInstance();
+ if (file_exists($this->filename)) {
+ include_once $this->filename;
+ foreach ($tbl_files_list as $onefile) {
+ if (xoops_trim($onefile)!='') {
+ $onefile=$myts->htmlSpecialChars($onefile);
+ $ret[$onefile]=$onefile;
+ }
+ }
+ }
+ asort($ret);
+ $this->files=$ret;
+
+ return $ret;
+ }
+
+ /**
+ * Remove one or many files from the list
+ */
+ function delete($file)
+ {
+ if (is_array($file)) {
+ foreach ($file as $onefile) {
+ if (isset($this->files[$onefile])) {
+ unset($this->files[$onefile]);
+ }
+ }
+ } else {
+ if (isset($this->files[$file])) {
+ unset($this->files[$file]);
+ }
+ }
+ }
+
+ /**
+ * Add one or many Files
+ */
+ function addfiles($file)
+ {
+ $myts =& MyTextSanitizer::getInstance();
+ if (is_array($file)) {
+ foreach ($file as $onefile) {
+ $onefile=xoops_trim($myts->htmlSpecialChars($onefile));
+ $this->files[$onefile]=$onefile;
+ }
+ } else {
+ $file=xoops_trim($myts->htmlSpecialChars($file));
+ $this->files[$file]=$file;
+ }
+
+ }
+
+ /**
+ * Save files
+ */
+ function store()
+ {
+ if (file_exists($this->filename)) {
+ unlink($this->filename);
+ }
+ $fd = fopen($this->filename,'w') or die('Error unable to create storage files list');
+ fputs($fd,"<?php\n");
+ fputs($fd,'$tbl_files_list = array('."\n");
+ foreach ($this->files as $onefile) {
+ fputs($fd,"\"".$onefile."\",\n");
+ }
+ fputs($fd,"'');\n");
+ fputs($fd,"?>\n");
+ fclose($fd);
+ }
+}
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/docs/changelog.txt
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/docs/changelog.txt 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/docs/changelog.txt 2014-04-25 11:35:52 UTC (rev 12475)
@@ -1,17 +1,28 @@
+1.73 Beta 1 2014-04-23
+=================================
+- moved all images, CSS, and JS files to /assets (mamba)
+- renamed .html Smarty templates to .tpl (mamba)
+
============================
-Version 1.71 2011/06/30:
+1.72 2014-03-12
============================
+- Small code changes (mamba)
+- set default directory to /uploads/boox
+
+============================
+1.71 2011/06/30:
+============================
- Conversion to XOOPS 2.5.0 GUI (mamba)
- converting to dynamic Editor selection
============================
-Version 1.70 2011/12/12:
+1.70 2011/12/12:
============================
- The module requires at least Xoops 2.3
- Better support for Xoops 2.3 (and up) editors
============================
-Version 1.60 2006/9/8:
+1.60 2006/9/8:
============================
- Better support of Xoops 2.3
- Addition of support for the TinyMCEeditor
@@ -19,6 +30,6 @@
- Translations available in UTF8 (French & English)
============================
-Version 1.40 2006/9/8:
+1.40 2006/9/8:
============================
-- original release (hervet)
\ No newline at end of file
+- original release (hervet)
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/include/functions.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/include/functions.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/include/functions.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -1,151 +1,157 @@
-<?php
-/**
- * ****************************************************************************
- * boox - MODULE FOR XOOPS
- * Copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
- * @package boox
- * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com)
- *
- * Version : $Id:
- * ****************************************************************************
- */
-
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-/**
- * Returns a module's option
- *
- * Return's a module's option (for the news module)
- *
- * @package Boox
- * @author Instant Zero (http://xoops.instant-zero.com)
- * @copyright (c) Instant Zero
- * @param string $option module option's name
- */
-function boox_getmoduleoption($option, $repmodule='boox')
-{
- global $xoopsModuleConfig, $xoopsModule;
- static $tbloptions= Array();
- if(is_array($tbloptions) && array_key_exists($option,$tbloptions)) {
- return $tbloptions[$option];
- }
-
- $retval=false;
- if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) {
- if(isset($xoopsModuleConfig[$option])) {
- $retval= $xoopsModuleConfig[$option];
- }
- } else {
- $module_handler =& xoops_gethandler('module');
- $module =& $module_handler->getByDirname($repmodule);
- $config_handler =& xoops_gethandler('config');
- if ($module) {
- $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
- if(isset($moduleConfig[$option])) {
- $retval= $moduleConfig[$option];
- }
- }
- }
- $tbloptions[$option]=$retval;
- return $retval;
-}
-
-/**
- * Is Xoops 2.3.x ?
- *
- * @return boolean need to say it ?
- */
-function boox_isX23()
-{
- $x23 = false;
- $xv = str_replace('XOOPS ','',XOOPS_VERSION);
- if(intval(substr($xv,2,1)) >= 3) {
- $x23 = true;
- }
- return $x23;
-}
-
-
-/**
- * Retreive an editor according to the module's option "form_options"
- *
- * @param string $caption Caption to give to the editor
- * @param string $name Editor's name
- * @param string $value Editor's value
- * @param string $width Editor's width
- * @param string $height Editor's height
- * @return object The editor to use
- */
-function boox_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
-{
- $editor = false;
- $editor_configs = array();
- $editor_configs['name'] = $name;
- $editor_configs['value'] = $value;
- $editor_configs['rows'] = 35;
- $editor_configs['cols'] = 60;
- $editor_configs['width'] = '100%';
- $editor_configs['height'] = '400px';
- $editor_option = strtolower(boox_getmoduleoption('form_options'));
- if (boox_isX23()) {
- $editor = new XoopsFormEditor($caption, $editor_option, $editor_configs);
- return $editor;
- }
- // Only for Xoops 2.0.x
- switch ($editor_option) {
- case 'fckeditor':
- if (is_readable(XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php')) {
- require_once (XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php');
- $editor = new XoopsFormFckeditor($caption, $name, $value);
- }
- break;
- case 'htmlarea':
- if (is_readable(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php')) {
- require_once (XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php');
- $editor = new XoopsFormHtmlarea($caption, $name, $value);
- }
- break;
- case 'dhtmltextarea':
- $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 10, 50, $supplemental);
- break;
- case 'textarea':
- $editor = new XoopsFormTextArea($caption, $name, $value);
- break;
- case 'tinyeditor':
- case 'tinymce':
- if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php')) {
- require_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php';
- $editor = new XoopsFormTinyeditorTextArea(array('caption' => $caption , 'name' => $name , 'value' => $value , 'width' => '100%' , 'height' => '400px'));
- }
- break;
- case 'koivi':
- if (is_readable(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php')) {
- require_once (XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php');
- $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, $width, $height, '');
- }
- break;
- }
- return $editor;
-}
-
-
-/**
- * Create (in a link) a javascript confirmation box
- */
-function boox_JavascriptLinkConfirm($msg)
-{
- return "onclick=\"javascript:return confirm('".str_replace("'"," ",$msg)."')\"";
-}
-?>
\ No newline at end of file
+<?php
+/**
+ * ****************************************************************************
+ * boox - MODULE FOR XOOPS
+ * Copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
+ * @package boox
+ * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ *
+ * Version : $Id:
+ * ****************************************************************************
+ */
+
+defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
+
+/**
+ * Returns a module's option
+ *
+ * Return's a module's option (for the news module)
+ *
+ * @package Boox
+ * @author Instant Zero (http://xoops.instant-zero.com)
+ * @copyright (c) Instant Zero
+ *
+ * @param string $option module option's name
+ * @param string $repmodule
+ *
+ * @return bool
+ * @return bool
+ */
+function boox_getmoduleoption($option, $repmodule='boox')
+{
+ global $xoopsModuleConfig, $xoopsModule;
+ static $tbloptions= Array();
+ if (is_array($tbloptions) && array_key_exists($option,$tbloptions)) {
+ return $tbloptions[$option];
+ }
+
+ $retval=false;
+ if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) {
+ if (isset($xoopsModuleConfig[$option])) {
+ $retval= $xoopsModuleConfig[$option];
+ }
+ } else {
+ $module_handler =& xoops_gethandler('module');
+ $module =& $module_handler->getByDirname($repmodule);
+ $config_handler =& xoops_gethandler('config');
+ if ($module) {
+ $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+ if (isset($moduleConfig[$option])) {
+ $retval= $moduleConfig[$option];
+ }
+ }
+ }
+ $tbloptions[$option]=$retval;
+
+ return $retval;
+}
+
+/**
+ * Is Xoops 2.3.x ?
+ *
+ * @return boolean need to say it ?
+ */
+function boox_isX23()
+{
+ $x23 = false;
+ $xv = str_replace('XOOPS ','',XOOPS_VERSION);
+ if (intval(substr($xv,2,1)) >= 3) {
+ $x23 = true;
+ }
+
+ return $x23;
+}
+
+/**
+ * Retreive an editor according to the module's option "form_options"
+ *
+ * @param string $caption Caption to give to the editor
+ * @param string $name Editor's name
+ * @param string $value Editor's value
+ * @param string $width Editor's width
+ * @param string $height Editor's height
+ * @param string $supplemental
+ * @return object The editor to use
+*/
+function boox_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
+{
+ $editor = false;
+ $editor_configs = array();
+ $editor_configs['name'] = $name;
+ $editor_configs['value'] = $value;
+ $editor_configs['rows'] = 35;
+ $editor_configs['cols'] = 60;
+ $editor_configs['width'] = '100%';
+ $editor_configs['height'] = '400px';
+ $editor_option = strtolower(boox_getmoduleoption('form_options'));
+ if (boox_isX23()) {
+ $editor = new XoopsFormEditor($caption, $editor_option, $editor_configs);
+
+ return $editor;
+ }
+ // Only for Xoops 2.0.x
+ switch ($editor_option) {
+ case 'fckeditor':
+ if (is_readable(XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php')) {
+ require_once (XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php');
+ $editor = new XoopsFormFckeditor($caption, $name, $value);
+ }
+ break;
+ case 'htmlarea':
+ if (is_readable(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php')) {
+ require_once (XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php');
+ $editor = new XoopsFormHtmlarea($caption, $name, $value);
+ }
+ break;
+ case 'dhtmltextarea':
+ $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 10, 50, $supplemental);
+ break;
+ case 'textarea':
+ $editor = new XoopsFormTextArea($caption, $name, $value);
+ break;
+ case 'tinyeditor':
+ case 'tinymce':
+ if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php')) {
+ require_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php';
+ $editor = new XoopsFormTinyeditorTextArea(array('caption' => $caption , 'name' => $name , 'value' => $value , 'width' => '100%' , 'height' => '400px'));
+ }
+ break;
+ case 'koivi':
+ if (is_readable(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php')) {
+ require_once (XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php');
+ $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, $width, $height, '');
+ }
+ break;
+ }
+
+ return $editor;
+}
+
+
+/**
+ * Create (in a link) a javascript confirmation box
+ */
+function boox_JavascriptLinkConfirm($msg)
+{
+ return "onclick=\"javascript:return confirm('".str_replace("'"," ",$msg)."')\"";
+}
Added: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/index.html
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/index.html (rev 0)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/index.html 2014-04-25 11:35:52 UTC (rev 12475)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/admin.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/admin.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/admin.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -25,7 +25,7 @@
define("_AM_BOOX_MODULEADMIN","Module's admin");
define("_AM_BOOX_EDIT","Edit");
define("_AM_BOOX_DELETE","Delete");
-define("_AM_BOOX_ADD","Add");
+define("_AM_BOOX_ADD","Add new Block");
define("_AM_BOOX_CONFIRM","Are you sure ?");
define("_AM_BOOX_FILES","Files");
define("_AM_BOOX_FILE","File");
@@ -38,4 +38,4 @@
define("_AM_BOOX_CONTENT","Content");
//ModuleAdmin
-define('_AM_BOOX_MODULEADMIN_MISSING','Error: The ModuleAdmin class is missing. Please install the ModuleAdmin Class into /Frameworks (see /docs/readme.txt)');
\ No newline at end of file
+define('_AM_BOOX_MODULEADMIN_MISSING','Error: The ModuleAdmin class is missing. Please install the ModuleAdmin Class into /Frameworks (see /docs/readme.txt)');
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/modinfo.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/modinfo.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/language/english/modinfo.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -35,4 +35,4 @@
define('_MI_BOOX_MENU_00',"Home");
define('_MI_BOOX_MENU_01',"Boox Manager");
-define('_MI_BOOX_ADMIN_ABOUT',"About");
\ No newline at end of file
+define('_MI_BOOX_ADMIN_ABOUT',"About");
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/xoops_version.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/xoops_version.php 2014-04-25 11:31:21 UTC (rev 12474)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/boox/xoops_version.php 2014-04-25 11:35:52 UTC (rev 12475)
@@ -20,47 +20,44 @@
* ****************************************************************************
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die("XOOPS root path not defined");
-}
+defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
-$modversion['name'] = _MI_BOOX_NAME;
-$modversion['version'] = 1.71;
+$modversion['name'] = _MI_BOOX_NAME;
+$modversion['version'] = 1.73;
$modversion['description'] = _MI_BOOX_DESC;
-$modversion['credits'] = 'wilson';
-$modversion['author'] = 'Hervé Thouzard (http://www.herve-thouzard.com)';
-$modversion['license'] = 'GNU GPL 2.0';
-$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/";
-$modversion['help'] = 'page=help';
-$modversion['official'] = 0;
-$modversion['image'] = 'images/boox_logo.png';
-$modversion['dirname'] = 'boox';
+$modversion['credits'] = 'wilson';
+$modversion['author'] = 'Hervé Thouzard (http://www.herve-thouzard.com)';
+$modversion['license'] = 'GNU GPL 2.0';
+$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html";
+$modversion['help'] = 'page=help';
+$modversion['official'] = 0;
+$modversion['image'] = 'assets/images/boox_logo.png';
+$modversion['dirname'] = basename(dirname(__FILE__));
-$modversion['official'] = 0;
+$modversion['official'] = 0;
$modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin';
-$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16';
-$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32';
+$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16';
+$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32';
//about
-$modversion["demo_site_url"] = '';
-$modversion["demo_site_name"] = '';
-$modversion["module_website_url"] = 'http://xoops.org';
+$modversion["module_status"] = "Beta 1";
+$modversion["release_date"] = "2014/04/23";
+$modversion["demo_site_url"] = '';
+$modversion["demo_site_name"] = '';
+$modversion["module_website_url"] = 'http://xoops.org';
$modversion["module_website_name"] = 'XOOPS';
-$modversion["release"] = '0';
-$modversion["module_status"] = 'Final';
-$modversion['release_date'] = '2012/06/27';
-$modversion['min_php'] = '5.2';
-$modversion['min_xoops'] = '2.5.5';
-$modversion['min_admin']='1.1';
+$modversion["release"] = '0';
+$modversion['min_php'] = '5.3.7';
+$modversion['min_xoops'] = '2.5.5';
+$modversion['min_admin'] = '1.1';
//$modversion['min_db']= array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7');
$modversion['sqlfile']['mysql'] = '';
-
// Admin things
-$modversion['hasAdmin'] = 1;
-$modversion['adminindex'] = 'admin/index.php';
-$modversion['adminmenu'] = 'admin/menu.php';
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = 'admin/index.php';
+$modversion['adminmenu'] = 'admin/menu.php';
$modversion['system_menu'] = 1;
// Templates
@@ -76,7 +73,6 @@
// Comments
$modversion['hasComments'] = 0;
-
/**
* Where do you want to save your files ?
*/
@@ -86,12 +82,12 @@
$modversion['config'][$i]['description'] = '_MI_BOOX_OPT0_DSC';
$modversion['config'][$i]['formtype'] = 'textbox';
$modversion['config'][$i]['valuetype'] = 'text';
-$modversion['config'][$i]['default'] = XOOPS_UPLOAD_PATH;
+$modversion['config'][$i]['default'] = XOOPS_UPLOAD_PATH.'/'.$modversion['dirname'];
/**
* Which editor to use ?
*/
-$i++;
+++$i;
$modversion['config'][$i]['name'] = 'form_options';
$modversion['config'][$i]['title'] = "_MI_BOOX_FORM_OPTIONS";
$modversion['config'][$i]['description'] = '';
@@ -102,11 +98,10 @@
$editor_handler = XoopsEditorHandler::getInstance();
$modversion['config'][$i]['options'] = array_flip($editor_handler->getList());
-
/**
* Trim file's content before to save it ?
*/
-$i++;
+++$i;
$modversion['config'][$i]['name'] = 'trimcontent';
$modversion['config'][$i]['title'] = '_MI_BOOX_OPT1';
$modversion['config'][$i]['description'] = '_MI_BOOX_OP1_DSC';
@@ -117,4 +112,3 @@
// Notifications
$modversion['hasNotification'] = 0;
-?>
\ No newline at end of file
|