|
From: <be...@us...> - 2013-08-22 00:08:46
|
Revision: 11962
http://sourceforge.net/p/xoops/svn/11962
Author: beckmi
Date: 2013-08-22 00:08:41 +0000 (Thu, 22 Aug 2013)
Log Message:
-----------
Adding WYSIWYG Editor selection to preferences
Modified Paths:
--------------
XoopsModules/extcal/trunk/modules/extcal/admin/event.php
XoopsModules/extcal/trunk/modules/extcal/class/event.php
XoopsModules/extcal/trunk/modules/extcal/docs/changelog.txt
XoopsModules/extcal/trunk/modules/extcal/event.php
XoopsModules/extcal/trunk/modules/extcal/language/english/admin.php
XoopsModules/extcal/trunk/modules/extcal/language/english/modinfo.php
XoopsModules/extcal/trunk/modules/extcal/templates/extcal_event.html
XoopsModules/extcal/trunk/modules/extcal/versions/extcal_2_28.php
XoopsModules/extcal/trunk/modules/extcal/xoops_version.php
Modified: XoopsModules/extcal/trunk/modules/extcal/admin/event.php
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/admin/event.php 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/admin/event.php 2013-08-22 00:08:41 UTC (rev 11962)
@@ -94,9 +94,12 @@
// Event edited
if (isset($_POST['event_id'])) {
- $eventHandler->modifyEvent($_POST['event_id'], $data);
- $fileHandler->createFile(intval($_POST['event_id']));
- redirect_header("event.php", 3, _AM_EXTCAL_EVENT_EDITED, false);
+ if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) {
+ redirect_header("event.php", 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false);
+ } else {
+ $fileHandler->createFile(intval($_POST['event_id']));
+ redirect_header("event.php", 3, _AM_EXTCAL_EVENT_EDITED, false);
+ }
// New event
} else {
@@ -107,12 +110,18 @@
: 0;
$data['event_submitdate'] = time();
- $eventHandler->createEvent($data, $_POST);
+ if ($eventHandler->createEvent($data, $_POST)) {
+
$fileHandler->createFile($eventHandler->getInsertId());
$cat = $catHandler->getCat($_POST['cat_id'], $xoopsUser, 'all');
$notificationHandler->triggerEvent('global', 0, 'new_event', array('EVENT_TITLE' => $_POST['event_title']));
$notificationHandler->triggerEvent('cat', $_POST['cat_id'], 'new_event_cat', array('EVENT_TITLE' => $_POST['event_title'], 'CAT_NAME' => $cat->getVar('cat_name')));
redirect_header("event.php", 3, _AM_EXTCAL_EVENT_CREATED, false);
+ }
+ else {
+ redirect_header("event.php", 3, _AM_EXTCAL_EVENT_CREATE_FAILED, false);
+ }
+
}
break;
Modified: XoopsModules/extcal/trunk/modules/extcal/class/event.php
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/class/event.php 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/class/event.php 2013-08-22 00:08:41 UTC (rev 11962)
@@ -303,6 +303,7 @@
{
//ext_echoArray($criteres);
global $extcalConfig;
+ $myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object
$eventsU = $this->getEventsUniques($criteres);
$eventsR = $this->getEventsRecurents($criteres);
@@ -324,6 +325,7 @@
if ($v['event_icone'] == '') {
$v['event_icone'] = $v['cat']['cat_icone'];
}
+ $v['event_desc'] = html_entity_decode($v['event_desc']);
$eventArray[] = $v;
}
array_multisort($eventArray, SORT_ASC, SORT_NUMERIC, $ordre, SORT_ASC, SORT_NUMERIC);
@@ -410,7 +412,7 @@
}
/*****************************************************************
- * evennement r\xE9curents
+ * evennement récurents
*****************************************************************/
function getEventsRecurents($criteres)
@@ -494,7 +496,7 @@
$events = $this->objectToArray($result, $externalKeys);
$this->serverTimeToUserTimes($events);
- //Balyage de tous les evennements r\xE9currents et creation de toutes le events
+ //Balyage de tous les evennements récurrents et creation de toutes le events
$eventsR = array();
while (list($k, $event) = each($events)) {
//$te = $this->GetInterval($event, $start, $end);
@@ -606,7 +608,7 @@
/**********************************************************************
- * Construction des criteres en fonction de la p\xE9riode
+ * Construction des criteres en fonction de la période
**********************************************************************/
function _getCriteriaCompo($start, $end, $cat, &$user)
@@ -811,6 +813,7 @@
**********************************************************************/
function getEventForm($siteSide = 'user', $mode = 'new', $data = null)
{
+ global $xoopsModuleConfig;
$catHandler = xoops_getmodulehandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
$fileHandler = xoops_getmodulehandler(_EXTCAL_CLS_FILE, _EXTCAL_MODULE);
@@ -1056,11 +1059,33 @@
//-----------------------------------------------------------
-
// Start and end
new ExtcalFormDateTime($form, $startDateValue, $endDateValue); //mb
+
+ global $xoopsUser, $xoopsModule;
+ $isAdmin = false;
+ if (is_object($xoopsUser)) {
+ $isAdmin = $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
+ }
+
// Description
- $form->addElement(new XoopsFormDhtmlTextArea(_MD_EXTCAL_DESCRIPTION, 'event_desc', $desc, 10), false);
+ if (class_exists('XoopsFormEditor')) {
+ $options['name'] = 'event_desc';
+ $options['value'] = $desc;
+ $options['rows'] = 5;
+ $options['cols'] = '100%';
+ $options['width'] = '100%';
+ $options['height'] = '200px';
+ if ($isAdmin) {
+ $descEditor = new XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorAdmin'], $options, $nohtml = false, $onfailure = 'textarea');
+ } else {
+ $descEditor = new XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorUser'], $options, $nohtml = false, $onfailure = 'textarea');
+ }
+ } else {
+ $descEditor = new XoopsFormDhtmlTextArea(_MD_EXTCAL_DESCRIPTION, 'event_desc', $desc, '100%', '100%');
+ }
+ $form->addElement($descEditor);
+
// Max registered member for this event
$nbMemberElement = new XoopsFormText(_MD_EXTCAL_NBMEMBER, 'event_nbmember', 4, 4, $nbMember);
$nbMemberElement->setDescription(_MD_EXTCAL_NBMEMBER_DESC);
@@ -1082,8 +1107,27 @@
$form->addElement(new XoopsFormText(_MD_EXTCAL_URL, 'event_url', 80, 255, $url), false);
// Email
$form->addElement(new XoopsFormText(_MD_EXTCAL_EMAIL, 'event_email', 80, 255, $email), false);
+
// Address
- $form->addElement(new XoopsFormDhtmlTextArea(_MD_EXTCAL_ADDRESS, 'event_address', $event_address), false);
+ if (class_exists('XoopsFormEditor')) {
+ $options['name'] = 'event_address';
+ $options['value'] = $event_address;
+ $options['rows'] = 5;
+ $options['cols'] = '100%';
+ $options['width'] = '100%';
+ $options['height'] = '200px';
+ if ($isAdmin) {
+ $addressEditor
+ = new XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorAdmin'], $options, $nohtml = false, $onfailure = 'textarea');
+ } else {
+ $addressEditor = new XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorUser'], $options, $nohtml = false, $onfailure = 'textarea');
+ }
+ } else {
+ $addressEditor = new XoopsFormDhtmlTextArea(_MD_EXTCAL_DESCRIPTION, 'event_address', $event_address, '100%', '100%');
+ }
+ $form->addElement($addressEditor);
+
+
// Recurence form
$form->addElement(new ExtcalFormRecurRules($reccurOptions));
// File attachement
@@ -2446,4 +2490,3 @@
//-------------------------------------------------
} // -------- Fin e la classe ---------------------
-?>
Modified: XoopsModules/extcal/trunk/modules/extcal/docs/changelog.txt
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/docs/changelog.txt 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/docs/changelog.txt 2013-08-22 00:08:41 UTC (rev 11962)
@@ -1,3 +1,8 @@
+2013/08/21: Version 2.38 Beta 1
+===================================
+- added editor selection in Preferences for Admin and User (mamba)
+- added checks if event was added/modified successfully (mamba)
+
2013/07/10: Version 2.37 Final
===================================
- small changes for PHP 5.4
Modified: XoopsModules/extcal/trunk/modules/extcal/event.php
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/event.php 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/event.php 2013-08-22 00:08:41 UTC (rev 11962)
@@ -26,10 +26,18 @@
$permHandler = ExtcalPerm::getHandler();
include_once XOOPS_ROOT_PATH."/modules/extcal/class/etablissement.php";
include_once XOOPS_ROOT_PATH."/modules/extcal/include/functions.php";
+$myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object
+if (!function_exists('clear_unicodeslashes')){
+ function clear_unicodeslashes($text) {
+ $text = str_replace(array("\\'"), "'", $text);
+ $text = str_replace(array("\\\\\\'"), "'", $text);
+ $text = str_replace(array('\\"'), '"', $text);
+ return $text;
+ }
+}
-
// Retriving event
$eventObj = $eventHandler->getEvent($eventId);
@@ -48,6 +56,8 @@
// Assigning event to the template
$xoopsTpl->assign('event', $event);
+$xoopsTpl->assign('event_desc', html_entity_decode($myts->displayTarea(clear_unicodeslashes($event['event_desc']), 1, 1, 1, 1, 1)));
+$xoopsTpl->assign('event_address', html_entity_decode($myts->displayTarea(clear_unicodeslashes($event['event_address']), 1, 1, 1, 1, 1)));
// Title of the page
$xoopsTpl->assign('xoops_pagetitle', $event['event_title']);
Modified: XoopsModules/extcal/trunk/modules/extcal/language/english/admin.php
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/language/english/admin.php 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/language/english/admin.php 2013-08-22 00:08:41 UTC (rev 11962)
@@ -37,7 +37,7 @@
define('_AM_EXTCAL_CAT_DELETED',"Category successfully deleted.");
define('_AM_EXTCAL_CAT_EDITED',"Category edited");
define('_AM_EXTCAL_CATEGORY',"Category");
-define('_AM_EXTCAL_CHECK_UPDATE_ERROR',"Can\'t retrieve the last version of eXtCal.");
+define('_AM_EXTCAL_CHECK_UPDATE_ERROR',"Can't retrieve the last version of eXtCal.");
define('_AM_EXTCAL_COLOR',"Color");
define('_AM_EXTCAL_CONFIG_CHECK',"Configurations");
define('_AM_EXTCAL_CONFIG_PHP',"You must have at least %s as a php version (your current version is %s)");
@@ -48,7 +48,7 @@
define('_AM_EXTCAL_CONFIRM_DELETE_SELECTION',"Delete seleted");
define('_AM_EXTCAL_DELETE',"Select to Delete");
define('_AM_EXTCAL_DELETE_ALL',"Delete All");
-define('_AM_EXTCAL_DELETE_SELECTION',"Delete selected");
+define('_AM_EXTCAL_DELETE_SELECTION', "Delete selected");
define('_AM_EXTCAL_DESCRIPTION',"Description");
define('_AM_EXTCAL_DOWN_DONE',"Downloading done. Click here to install files");
define('_AM_EXTCAL_EDIT_CATEGORY',"Edit category");
@@ -90,7 +90,7 @@
define('_AM_EXTCAL_INSTALL_DONE',"Installing done. Click here to update your module");
define('_AM_EXTCAL_LG_FILE_DONT_EXIST',"Language files don\'t exist in repository: <br /><b>Server : </b>%s<br /><b>File : </b>%s");
define('_AM_EXTCAL_MD_FILE_DONT_EXIST',"Module files don\'t exist on repository :<br /><b>Server : </b>%s<br /><b>File : </b>%s");
-define('_AM_EXTCAL_MD_FILE_DONT_EXIST_SHORT',"Module files don\'t exist");
+define('_AM_EXTCAL_MD_FILE_DONT_EXIST_SHORT',"Module files don't exist");
define('_AM_EXTCAL_MODULE_ADMIN_SUMMARY',"eXtCal Administration Summary");
define('_AM_EXTCAL_MULTIUPLOADS_NOT_OK',"The multiuploads component is not installed.<br /><br /><a href='http://xoops.kiolo.com/modules/mydownloads/'>Download here the multiuploads component</a><br /><br />and install it in the folder 'class/xoopsform/'");
define('_AM_EXTCAL_NAME',"Name");
@@ -101,7 +101,7 @@
define('_AM_EXTCAL_PERM_NO_CATEGORY',"You must create category first");
define('_AM_EXTCAL_PREFERENCES',"Preferences");
define('_AM_EXTCAL_PUBLIC_PERM_MASK',"Public permissions mask");
-define('_AM_EXTCAL_PUBLIC_PERM_MASK_INFO',"You can set here the default mask permission who will be apply to new category. Be careful to don\'t give excessive permissions here because all new category will give them.");
+define('_AM_EXTCAL_PUBLIC_PERM_MASK_INFO',"You can set here the default mask permission who will be apply to new category. Be careful to don't give excessive permissions here because all new category will give them.");
define('_AM_EXTCAL_REDIRECT_DELOK',"successfully deleted");
define('_AM_EXTCAL_START_DATE',"Start Date");
define('_AM_EXTCAL_SUBMIT_PERMISSION',"Submit permission");
@@ -122,4 +122,7 @@
//2.37
define('_AM_EXTCAL_END_DATE',"End Date");
define('_AM_EXTCAL_EVENT_CLONED',"Event successfully cloned.");
-define('_AM_EXTCAL_ETABLISSEMENT_FORM_CITY',"City");
\ No newline at end of file
+define('_AM_EXTCAL_ETABLISSEMENT_FORM_CITY',"City");
+// 2.38
+define('_AM_EXTCAL_EVENT_EDIT_FAILED',"Event Editing failed");
+define('_AM_EXTCAL_EVENT_CREATE_FAILED',"Couldn't create event");
Modified: XoopsModules/extcal/trunk/modules/extcal/language/english/modinfo.php
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/language/english/modinfo.php 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/language/english/modinfo.php 2013-08-22 00:08:41 UTC (rev 11962)
@@ -152,4 +152,12 @@
define('_MI_EXTCAL_DAY_FRIDAY',"Friday");
define('_MI_EXTCAL_DAY_SATURDAY',"Saturday");
define('_MI_EXTCAL_DAY_SUNDAY',"Sunday");
-define('_MI_EXTCAL_SHOW_OTHEROPTIONS',"Other Options");
\ No newline at end of file
+define('_MI_EXTCAL_SHOW_OTHEROPTIONS',"Other Options");
+
+// 2.38
+
+define('_MI_EXTCAL_EDITOR_ADMIN', "Editor to use (admin):");
+define('_MI_EXTCAL_EDITOR_ADMIN_DESC', "Select the editor to use for admin side. If you have a 'simple' install (e.g you use only XOOPS core editor class, provided in the standard xoops core package), then you can just select DHTML and Compact");
+define('_MI_EXTCAL_EDITOR_USER', "Editor to use (user):");
+define('_MI_EXTCAL_EDITOR_USER_DESC', "Select the editor to use for user side. If you have a 'simple' install (e.g you use only XOOPS core editor class, provided in the standard xoops core package), then you can just select DHTML and Compact");
+
Modified: XoopsModules/extcal/trunk/modules/extcal/templates/extcal_event.html
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/templates/extcal_event.html 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/templates/extcal_event.html 2013-08-22 00:08:41 UTC (rev 11962)
@@ -61,12 +61,12 @@
<{if $event.event_desc != ''}>
<u><strong><{$smarty.const._MD_EXTCAL_ETABLISSEMENT_DESCRIPTION}> :</strong></u><br />
- <{$event.event_desc}><br /><br />
+ <{$event_desc}><br /><br />
<{/if}>
<{if $event.event_address != ''}>
<u><strong><{$smarty.const._MD_EXTCAL_ETABLISSEMENT_ADRESSE}> :</strong></u><br />
- <{$event.event_address}><br /><br />
+<{$event_address}><br /><br />
<{/if}>
<!--<span style="font-size:0.8em;"><{$smarty.const._MD_EXTCAL_POSTED_BY}> <a href="<{$xoops_url}>/userinfo.php?uid=<{$event.user.uid}>"><{$event.user.uname}></a> <{$smarty.const._MD_EXTCAL_ON}> <{$event.formated_event_submitdate}></span>
<p>
Modified: XoopsModules/extcal/trunk/modules/extcal/versions/extcal_2_28.php
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/versions/extcal_2_28.php 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/versions/extcal_2_28.php 2013-08-22 00:08:41 UTC (rev 11962)
@@ -40,7 +40,7 @@
add `event_picture1` varchar(255) NOT NULL,
add `event_picture2` varchar(255) NOT NULL,
add `event_price` varchar(255) NOT NULL default '',
- add `event_etablissement` int(5) NOT NULL DEFAULT '0';
+ add `event_etablissement` int(5) NOT NULL DEFAULT '1';
__sql__;
$xoopsDB->queryF($sql);
Modified: XoopsModules/extcal/trunk/modules/extcal/xoops_version.php
===================================================================
--- XoopsModules/extcal/trunk/modules/extcal/xoops_version.php 2013-08-21 17:11:58 UTC (rev 11961)
+++ XoopsModules/extcal/trunk/modules/extcal/xoops_version.php 2013-08-22 00:08:41 UTC (rev 11962)
@@ -3,7 +3,6 @@
if (!defined('XOOPS_ROOT_PATH')) {
die('XOOPS root path not defined');
}
-$moduleDirName = basename(dirname(__FILE__));
//include_once('include/constantes.php');
include_once(XOOPS_ROOT_PATH . '/modules/extcal/include/constantes.php');
include_once(XOOPS_ROOT_PATH . '/modules/extcal/include/agenda_fnc.php');
@@ -15,7 +14,7 @@
//***************************************************************************************
$modversion['name'] = _MI_EXTCAL_NAME;
-$modversion['version'] = '2.37';
+$modversion['version'] = '2.38';
$modversion['description'] = _MI_EXTCAL_DESC;
$modversion['credits'] = 'Zoullou';
$modversion['author'] = 'Zoullou, Mage, Mamba, JJ Delalandre (JJDai)';
@@ -25,7 +24,7 @@
$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/";
$modversion['official'] = 0;
$modversion['image'] = 'images/extcal_logo.png';
-$modversion['dirname'] = $moduleDirName;
+$modversion['dirname'] = basename(dirname(__FILE__));
//$modversion['status_version'] = 'Beta 4';
$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
$modversion['onInstall'] = 'include/install_function.php';
@@ -41,7 +40,7 @@
$modversion["module_website_url"] = "www.xoops.org/";
$modversion["module_website_name"] = "XOOPS";
$modversion["release_date"] = "2013/04/20";
-$modversion['module_status'] = "Final";
+$modversion['module_status'] = "Beta 1";
$modversion['min_php'] = '5.2';
$modversion['min_xoops'] = "2.5.6";
@@ -156,7 +155,29 @@
'_MI_EXTCAL_BEFORE' => 0, '_MI_EXTCAL_AFTER' => 1
);
+xoops_load('XoopsEditorHandler');
+$editor_handler = XoopsEditorHandler::getInstance();
+$editorList = array_flip($editor_handler->getList());
+
$i++;
+$modversion['config'][$i]['name'] = 'editorAdmin';
+$modversion['config'][$i]['title'] = "_MI_EXTCAL_EDITOR_ADMIN";
+$modversion['config'][$i]['description'] = "_MI_EXTCAL_EDITOR_ADMIN_DESC";
+$modversion['config'][$i]['formtype'] = 'select';
+$modversion['config'][$i]['valuetype'] = 'text';
+$modversion['config'][$i]['options'] = $editorList;
+$modversion['config'][$i]['default'] = 'dhtml';
+
+$i++;
+$modversion['config'][$i]['name'] = 'editorUser';
+$modversion['config'][$i]['title'] = "_MI_EXTCAL_EDITOR_USER";
+$modversion['config'][$i]['description'] = "_MI_EXTCAL_EDITOR_USER_DESC";
+$modversion['config'][$i]['formtype'] = 'select';
+$modversion['config'][$i]['valuetype'] = 'text';
+$modversion['config'][$i]['options'] = $editorList;
+$modversion['config'][$i]['default'] = 'dhtml';
+
+$i++;
$modversion['config'][$i]['name'] = 'rss_cache_time';
$modversion['config'][$i]['title'] = '_MI_EXTCAL_RSS_CACHE_TIME';
$modversion['config'][$i]['description'] = '_MI_EXTCAL_RSS_CACHE_TIME_DESC';
|