diff --git a/Camyks.php.inc b/Camyks.php.inc index fc661de9..6a146717 100755 --- a/Camyks.php.inc +++ b/Camyks.php.inc @@ -3,10 +3,10 @@ * @brief CaMykS CMS master class. * @details Engine / Main Object * @author CaMykS Team - * @version 1.0.21.1 + * @version 1.0.21.2 * @date Creation: Jun 2005 - * @date Modification: Dec 2020 - * @copyright 2005 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2005 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -2108,7 +2108,7 @@ final class Camyks { * @return string */ public function get_siteCurrentLink($lg='', $params=null) { - return $this->get_siteLink($this->contentPage->id, $this->contentPage->name, $lg, $params!=null ? $params : $this->contentPage->params); + return $this->get_siteLink($this->contentPage->id, $this->contentPage->name, $lg, !is_null($params) ? $params : $this->contentPage->params); } /** @@ -2144,7 +2144,7 @@ final class Camyks { * @param string $params * @return array */ - function get_siteLinkDecodeParams($params) { + public function get_siteLinkDecodeParams($params) { $p = array(); $params = explode('_', $params); for ($i=1; $ibenchMode!==false) $this->benchMode->start('CaMykS page loading'); + if ($this->benchMode !== false) $this->benchMode->start('CaMykS page loading'); switch ($this->mode) { case CAMYKS_MODE_SITE: @@ -2432,7 +2432,7 @@ final class Camyks { * @param array $params * @return string */ - public function get_siteLinkByName ($name, $lg='', $params=array()) { + public function get_siteLinkByName($name, $lg='', $params=array()) { $page = ContentPage::static_get_pageBasicInfoByName($name); return $this->get_rootBaseURL().$this->get_siteLink($page->id, $page->name, $lg, $params); } diff --git a/documents/changelogs/Release-20210101.md b/documents/changelogs/Release-20210101.md new file mode 100644 index 00000000..6f6e4048 --- /dev/null +++ b/documents/changelogs/Release-20210101.md @@ -0,0 +1,21 @@ +# CaMykS Changelog +## Release 20210101 + +* [2020-12-01 10:30:38 +0100 | JB Lebrun] Adds December 2020 release history in changelogs. [#View details](https://github.com/Dj1b/CaMykS/commit/c6197628158ca1184404785c3f498c288bab5ec6) +* [2020-12-01 12:33:05 +0100 | JB Lebrun] Normalises files format, indents more nicely the code and makes the Admin_Group module, ready to be parsed by Doxygen. [#View details](https://github.com/Dj1b/CaMykS/commit/825d80428bae45050150f5a47bc3ffeec60c4721) +* [2020-12-02 12:33:17 +0100 | Dj1b] Normalises files format, indents more nicely the code and makes the Admin_GenericBlogsManager module, ready to be parsed by Doxygen. [#View details](https://github.com/Dj1b/CaMykS/commit/1554e22bd9265a5d9fcf310a7549bbf876778f09) +* [2020-12-02 12:37:12 +0100 | Dj1b] Fixes PHP 8 Fatal error while calling vsprintf with textual parameters instead of an array in CaMykS main library. [#View details](https://github.com/Dj1b/CaMykS/commit/22a6e4dda1eed14090e6dd073364673a91a38176) +* [2020-12-02 12:43:05 +0100 | Dj1b] Fixes PHP deprecated constructor, keeping old websites compatibility in Input library. [#View details](https://github.com/Dj1b/CaMykS/commit/0a33d7e38dbcb4c0076257000557162eb6283f9d) +* [2020-12-03 17:57:47 +0100 | Dj1b] Normalises files format, indents more nicely the code and makes the Admin_GenericDownloadManager module, ready to be parsed by Doxygen. [#View details](https://github.com/Dj1b/CaMykS/commit/1f1ef7c917caa113dd5fc7b5dcae223b320bea45) +* [2020-12-04 09:28:31 +0100 | Dj1b] Fixes PHP Notice when buttons value is not properly set in HTMLForm library. [#View details](https://github.com/Dj1b/CaMykS/commit/6b055692c39a0782311dd4417ba8b3f3ed0aff41) +* [2020-12-07 20:28:55 +0100 | Dj1b] Updates PEAR Mail Mime libraries. [#View details](https://github.com/Dj1b/CaMykS/commit/da4fbcd75d89ee32f47d658013e54e50bf705901) +* [2020-12-07 20:33:10 +0100 | Dj1b] Fixes PHP warnings (Division by zero) in tab sub layouts in Admin_Statistics module. [#View details](https://github.com/Dj1b/CaMykS/commit/a81010880d7f28c398efa84458e0cd5ccc227305) +* [2020-12-12 11:09:58 +0100 | Dj1b] Inserts IPGeolocator input. [#View details](https://github.com/Dj1b/CaMykS/commit/64e4280557db26c4df6782a85d2765b81c238b8c) +* [2020-12-14 11:16:05 +0100 | Dj1b] Adds english locales and does some enhancements to IPGeolocator input. [#View details](https://github.com/Dj1b/CaMykS/commit/5df849f01641dac6add3e8a7cbdbf6388010b4e3) +* [2020-12-15 20:38:03 +0100 | Dj1b] Updates user agent detection in client library. [#View details](https://github.com/Dj1b/CaMykS/commit/b36885d9832bd46d91d5b16c92e074b013c6f8e9) +* [2020-12-16 17:58:54 +0100 | Dj1b] Adds Opcode status and cache reset features in Admin_Site module. [#View details](https://github.com/Dj1b/CaMykS/commit/e227ad46018c95bff5291cca2f35d2be05c848cc) +* [2020-12-21 17:10:43 +0100 | Dj1b] Updates FPDF library. [#View details](https://github.com/Dj1b/CaMykS/commit/ec3304d8414597fb984767184a871e004302fcf9) +* [2020-12-24 12:16:37 +0100 | Dj1b] Adds a parameter to insert an intermediate folder in social networks icon path in SocialNetworksSharingPanel input. [#View details](https://github.com/Dj1b/CaMykS/commit/32a75a55870bde8ac9b73e5d520d35040167a595) +* [2020-12-24 14:22:23 +0100 | Dj1b] Updates user agent detection in client library. [#View details](https://github.com/Dj1b/CaMykS/commit/08b41e5121630f0caf12d11a21da93243fabd853) +* [2020-12-24 14:23:04 +0100 | Dj1b] Does some files cleaning. [#View details](https://github.com/Dj1b/CaMykS/commit/5c3a934201acc0c018eb3cdd0b0a920f03c0df80) +* [2021-01-05 11:50:55 +0100 | Dj1b] Prepares release. [#View details](https://github.com/Dj1b/CaMykS/commit/b48820ce0941616d4a01888dc4301184ead1aa50) diff --git a/engine/etc/dynamic.php.inc b/engine/etc/dynamic.php.inc index e54a45fe..0cc605bf 100755 --- a/engine/etc/dynamic.php.inc +++ b/engine/etc/dynamic.php.inc @@ -3,16 +3,15 @@ * @brief CaMykS dynamic configuration * @brief Automatically loaded by CaMykS object. * @details Engine / Configuration file - * @file engine/etc/dynamic.php.inc * @author CaMykS Team - * @version 1.0 + * @version 1.0.0.1 * @date Creation: Sep 2005 - * @date Modification: Apr 2018 - * @copyright 2005 - 2018 CaMykS Team - * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * @date Modification: Jan 2021 + * @copyright 2005 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - + /** * @var array $this->_conf * @brief CaMykS Configuration @@ -30,10 +29,10 @@ */ $this->_conf = array( 'server_encoding' => 'utf8', - 'database_driver' => '', - 'database_host' => '', - 'database_login' => '', - 'database_password' => '', + 'database_driver' => '', + 'database_host' => '', + 'database_login' => '', + 'database_password' => '', 'ModuleActionDelay' => 4, 'TimeZone' => 'Europe/Paris', 'UserAgent' => 'Mozilla/5.0 (compatible; CaMykSRequest/1.0; +http://www.camyks.net/request_bot.html)', @@ -41,5 +40,5 @@ $this->_conf = array( /* load locale configuration */ if (file_exists($this->camyks_path.'/engine/etc/dynamic.local.php.inc')) - require($this->camyks_path.'/engine/etc/dynamic.local.php.inc'); + require $this->camyks_path.'/engine/etc/dynamic.local.php.inc'; ?> diff --git a/engine/etc/static.php.inc b/engine/etc/static.php.inc index ef1098ef..b6b0bfce 100755 --- a/engine/etc/static.php.inc +++ b/engine/etc/static.php.inc @@ -4,10 +4,10 @@ * @brief Automatically loaded by CaMykS object. * @details Engine / Configuration file * @author CaMykS Team - * @version 1.0.26 + * @version 1.0.27 * @date Creation: Sep 2005 - * @date Modification: Dec 2020 - * @copyright 2005 - 2020 CaMykS Team + * @date Modification: Feb 2021 + * @copyright 2005 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -22,7 +22,7 @@ $this->website = 'https://www.camyks.net'; * @var string $this->version * @brief CaMykS full version */ -$this->version = '1.0-20210101'; +$this->version = '1.0-20210201'; /** * @var string $this->mversion @@ -34,13 +34,13 @@ $this->mversion = '1.0'; * @var string $this->nversion * @brief CaMykS minor version */ -$this->nversion = '20210101'; +$this->nversion = '20210201'; /** * @var integer $this->last_modification_date * @brief CaMykS last modification date */ -$this->last_modification_date = mktime(0, 0, 0, 1, 1, 2021); +$this->last_modification_date = mktime(0, 0, 0, 2, 1, 2021); /** * @var string $this->engine_folder diff --git a/engine/lib/object/Plugin.php.inc b/engine/lib/object/Plugin.php.inc index 45be8c92..6f56ac9a 100755 --- a/engine/lib/object/Plugin.php.inc +++ b/engine/lib/object/Plugin.php.inc @@ -3,12 +3,11 @@ * @brief Plugin object *
Parent object for Module, Input, Template, Theme * @details Engine / Object Library - * @file engine/lib/object/Plugin.php.inc * @author CaMykS Team - * @version 1.0.8 + * @version 1.0.8.1 * @date Creation: Jun 2005 - * @date Modification: Jun 2019 - * @copyright 2005 - 2019 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2005 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -364,7 +363,7 @@ abstract class Plugin { */ protected function add_meta($name, $content, $method='name') { global $camyks; - $camyks->HTMLPage->add_meta ($name, $content, $method); + $camyks->HTMLPage->add_meta($name, $content, $method); } /***************** JS & CSS METHODS ******************/ diff --git a/engine/lib/tool/client.php.inc b/engine/lib/tool/client.php.inc index 330eccbe..a8a922cc 100755 --- a/engine/lib/tool/client.php.inc +++ b/engine/lib/tool/client.php.inc @@ -3,10 +3,10 @@ * @brief Client specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.128 + * @version 1.0.130 * @date Creation: Jun 2007 - * @date Modification: Dec 2020 - * @copyright 2007 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -124,19 +124,6 @@ function client_getUAInfos($ua=false) { /* load max versions to check and default fake value */ $fake = array('platform_type' => 'fake'); - /* check Playstation Portable * - if (preg_match('/PSP \(PlayStation Portable\); ([0-9\.]*)\)?$/', $ua, $matches)) - return _client_mergeUAInfos($req, array( - 'platform_company' => 'Sony', - 'platform_model' => 'Playstation Portable', - 'platform_type' => 'computer', - 'platform_format' => 'handheld', - 'system_title' => 'Playstation Portable', - 'system_version' => $matches[1], - 'browser_title' => 'PSP Browser', - 'browser_version' => '--', - )); - /* check Playstation 4 / Vita */ if (preg_match('/PlayStation (.*)(\)?;)?[ |\/]([0-9\.]*)\)/Ui', $ua, $matches)) { $model = 'PlayStation '.$matches[1]; @@ -357,7 +344,7 @@ function client_getUAInfos($ua=false) { } elseif (preg_match('/L[G|M]-?([A-Z]{1,2}[0-9]{3}\.?[A-Z]{0,})/', $ua, $matches) or preg_match('/LG([A-Z]{1,2}[0-9]*[A-Z]{0,})/', $ua, $matches)) { include_once('clientDevices/LG.php.inc'); $infos = array_merge($infos, get_LGClientDevice($matches[1])); - } elseif (preg_match('/ (VS[0-9]{3})( Build|\))/Ui', $ua, $matches)) { + } elseif (preg_match('/ (VS[0-9]{3})( 4G)?( Build|\))/Ui', $ua, $matches)) { include_once('clientDevices/LG.php.inc'); $infos = array_merge($infos, get_LGClientDevice($matches[1])); } @@ -383,6 +370,11 @@ function client_getUAInfos($ua=false) { 'platform_format' => 'handheld', )); + /* check Huawei - before Sony & Samsung */ + elseif (($device = _client_isHuaweiDevice($ua)) !== false) { + $infos = array_merge($infos, get_HuaweiClientDevice($device)); + } + /* check BQ devices, before Samsung */ elseif (preg_match('/ (Aquaris [A-Za-z0-9 \.]*)( Build|\))/i', $ua, $matches)) { include_once('clientDevices/BQ.php.inc'); @@ -439,11 +431,6 @@ function client_getUAInfos($ua=false) { 'platform_company' =>'Lenovo (PC)', )); - /* check Huawei - before Sony */ - elseif (($device = _client_isHuaweiDevice($ua)) !== false) { - $infos = array_merge($infos, get_HuaweiClientDevice($device)); - } - /* check Kyocera - before Sony */ elseif (($device = _client_isKyoceraDevice($ua)) !== false) { $infos = array_merge($infos, get_KyoceraClientDevice($device)); @@ -499,6 +486,13 @@ function client_getUAInfos($ua=false) { $infos = array_merge($infos, get_SpiceMobilityClientDevice($model)); } + /* check Sumvier devices - before Oukitel */ + elseif (preg_match('/; (K41)( Build|\))/Ui', $ua, $matches)) { + include_once('clientDevices/Sumvier.php.inc'); + $model = trim($matches[1]); + $infos = array_merge($infos, get_SumvierClientDevice($model)); + } + /* check Outikel mobiles */ elseif (preg_match('/; (K[0-9]{1,4})([A-zA-Z]*)?( Build|\))/', $ua, $matches)) { include_once('clientDevices/Oukitel.php.inc'); @@ -628,7 +622,7 @@ function client_getUAInfos($ua=false) { } /* check Doogee devices, to be inserted before Xiaomi/Wiko/Acer/Umidigi */ - elseif (preg_match('/; (MIX(Lite)?|MIX2|BL5000|S90|S60Lite|S88Pro|S55_Lite|X[37]0|X[0-9]0L|X95|X5max_PRO)( Build|\))/Ui', $ua, $matches)) { + elseif (preg_match('/; (MIX(Lite)?|MIX2|N20(Pro)?|BL5000|S90|S60Lite|S[58]8Pro|S55_Lite|X[37]0|X[0-9]0L|X95|X5max_PRO)( Build|\))/Ui', $ua, $matches)) { include_once('clientDevices/Doogee.php.inc'); $model = $matches[1]; $infos = array_merge($infos, get_DoogeeClientDevice($model)); @@ -722,7 +716,11 @@ function client_getUAInfos($ua=false) { } /* check Tecno devices */ - elseif (preg_match('/ Tecno[ |-|_]?([^;\-\)_]*)( Build|\))/Ui', $ua, $matches)) { + elseif (preg_match('/; Tecno[ |\-|_]?([A-Za-z0-9 ]+)( Build|\))/Ui', $ua, $matches)) { + include_once('clientDevices/Tecno.php.inc'); + $device = trim($matches[1]); + $infos = array_merge($infos, get_TecnoClientDevice($device)); + } elseif (preg_match('/; (Phantom6-Plus)( Build|\))/Ui', $ua, $matches)) { include_once('clientDevices/Tecno.php.inc'); $device = trim($matches[1]); $infos = array_merge($infos, get_TecnoClientDevice($device)); @@ -755,7 +753,7 @@ function client_getUAInfos($ua=false) { elseif (preg_match('/(Leagoo_| )(Elite|Alfa|Kiicaa|Lead)[ |_|-]?([^\)\/]*)( Build|\))/i', $ua, $matches)) { include_once('clientDevices/Leagoo.php.inc'); $infos = array_merge($infos, get_LeagooClientDevice($matches[2].' '.$matches[3])); - } elseif (preg_match('/(S8_Pro)( Build|\))/i', $ua, $matches)) { + } elseif (preg_match('/; (S8_Pro|Z6)( Build|\))/i', $ua, $matches)) { include_once('clientDevices/Leagoo.php.inc'); $infos = array_merge($infos, get_LeagooClientDevice($matches[1])); } @@ -810,18 +808,6 @@ function client_getUAInfos($ua=false) { $infos = array_merge($infos, get_OrangeClientDevice($matches[1])); } - /* check Logicom */ - elseif (preg_match('/L-EMENT_?([^.]*)( Build|\))/i', $ua, $matches)) { - include_once('clientDevices/Logicom.php.inc'); - $infos = array_merge($infos, get_LogicomClientDevice($matches[1])); - } elseif (preg_match('/ (M bot Tab [0-9]{3})( Build|\))/Ui', $ua, $matches)) { - include_once('clientDevices/Logicom.php.inc'); - $infos = array_merge($infos, get_LogicomClientDevice($matches[1])); - } elseif (preg_match('/; (L[a|e][_| ]?[^.]*)( Build|\))/Ui', $ua, $matches)) { - include_once('clientDevices/Logicom.php.inc'); - $infos = array_merge($infos, get_LogicomClientDevice($matches[1])); - } - /* check Coolpad devices */ elseif (preg_match('/; CP([0-9][A-Z0-9_\-]+)( Build|\))/Ui', $ua, $matches)) { include_once('clientDevices/Coolpad.php.inc'); @@ -832,7 +818,7 @@ function client_getUAInfos($ua=false) { } /* check Vestel devices */ - elseif (preg_match('/ (Venus_V3_5570) /', $ua, $matches)) { + elseif (preg_match('/; (Venus.*)( Build|\))/U', $ua, $matches)) { include_once('clientDevices/Vestel.php.inc'); $model = $matches[1]; $infos = array_merge($infos, get_VestelClientDevice($model)); @@ -924,7 +910,7 @@ function client_getUAInfos($ua=false) { include_once('clientDevices/Umi.php.inc'); $model = trim(preg_replace('/_|-/', ' ', $matches[1])); $infos = array_merge($infos, get_UmiClientDevice($model)); - } elseif (preg_match('/ (IRON|Rome|Hammer|eMax|Touch|Super)([ |_])?(Pro|X|S|Mini|4G)?( Build|\))/Ui', $ua, $matches)) { + } elseif (preg_match('/; Android [0-9\.]+; (IRON|Rome|Hammer|eMax|Touch|Super)([ |_])?(Pro|X|S|Mini|4G)?( Build|\))[^$]/Ui', $ua, $matches)) { include_once('clientDevices/Umi.php.inc'); $model = trim($matches[1].' '.$matches[3]); $infos = array_merge($infos, get_UmiClientDevice($model)); @@ -1413,7 +1399,7 @@ function client_getUAInfos($ua=false) { } /* check Chuwi devices */ - elseif (preg_match('/; (Hi10 pro)( Build|\))/Ui', $ua, $matches)) { + elseif (preg_match('/; (Hi[0-9]+ ?(pro|Air))( Build|\))/Ui', $ua, $matches)) { include_once('clientDevices/Chuwi.php.inc'); $device = $matches[1]; $infos = array_merge($infos, get_ChuwiClientDevice($device)); @@ -1630,7 +1616,7 @@ function client_getUAInfos($ua=false) { } /* check Teclast devices */ - elseif (preg_match('/; (TLA002)( Build|\))/U', $ua, $matches)) { + elseif (preg_match('/; (TLA002|M40_EEA)( Build|\))/U', $ua, $matches)) { include_once('clientDevices/Teclast.php.inc'); $device = $matches[1]; $infos = array_merge($infos, get_TeclastClientDevice($device)); @@ -1663,9 +1649,9 @@ function client_getUAInfos($ua=false) { include_once('clientDevices/Blackview.php.inc'); $device = preg_replace('/-|_/', ' ', trim($matches[1].$matches[2])); $infos = array_merge($infos, get_BlackviewClientDevice($device)); - } elseif (preg_match('/; (S8|A[68]0|0Pro)( Build|\))/', $ua, $matches)) { + } elseif (preg_match('/; (S8|A[68]0)(Pro)?( Build|\))/Ui', $ua, $matches)) { include_once('clientDevices/Blackview.php.inc'); - $device = preg_replace('/-|_/', ' ', trim($matches[1])); + $device = trim($matches[1].$matches[2]); $infos = array_merge($infos, get_BlackviewClientDevice($device)); } @@ -1699,6 +1685,18 @@ function client_getUAInfos($ua=false) { $infos = array_merge($infos, get_WikoClientDevice($model)); } + /* check Logicom, after Wiko */ + elseif (preg_match('/L-EMENT_?([^.]*)( Build|\))/i', $ua, $matches)) { + include_once('clientDevices/Logicom.php.inc'); + $infos = array_merge($infos, get_LogicomClientDevice($matches[1])); + } elseif (preg_match('/ (M bot Tab [0-9]{3})( Build|\))/Ui', $ua, $matches)) { + include_once('clientDevices/Logicom.php.inc'); + $infos = array_merge($infos, get_LogicomClientDevice($matches[1])); + } elseif (preg_match('/; (L[a|e][_| ]?[^.]*)( Build|\))/Ui', $ua, $matches)) { + include_once('clientDevices/Logicom.php.inc'); + $infos = array_merge($infos, get_LogicomClientDevice($matches[1])); + } + /* check CellAllure devices */ elseif (preg_match('/; (Fashion C)( Build|\))/Ui', $ua, $matches)) { include_once('clientDevices/CellAllure.php.inc'); @@ -1720,14 +1718,11 @@ function client_getUAInfos($ua=false) { $infos = array_merge($infos, get_MobicelClientDevice($device)); } - /* check Phh-Treble generic rom flashed device devices */ - elseif (preg_match('/ Phh-Treble(.*)( Build|\))/Ui', $ua, $matches)) { - $infos = array_merge($infos, array( - 'platform_company' => 'Flashed mobile with Phh-Treble generic ROM.', - 'platform_model' => '', - 'platform_type' => 'handheld', - 'platform_format' => 'handheld', - )); + /* check known Unknown devices */ + elseif (preg_match('/; (Phh-Treble|Unspecified Device).*( Build|\))/Ui', $ua, $matches)) { + include_once('clientDevices/Unknown.php.inc'); + $device = $matches[1]; + $infos = array_merge($infos, get_UnknownClientDevice($device)); } /*** check operating system ***/ @@ -1930,11 +1925,11 @@ function client_getUAInfos($ua=false) { /*** check browser ***/ - /* check opera mini */ - if (preg_match('/Opera Mini\/([0-9]+\.[0-9]+)/', $ua, $matches)) + /* check opera mini/news */ + if (preg_match('/Opera (Mini|News)\/([0-9]+\.[0-9]+)/', $ua, $matches)) $infos = array_merge(array( - 'browser_title' => 'Opera Mini', - 'browser_version' => $matches[1], + 'browser_title' => 'Opera '.$matches[1], + 'browser_version' => $matches[2], 'platform_type' => 'handheld', 'platform_format' => 'handheld', ), $infos); @@ -1999,7 +1994,7 @@ function client_getUAInfos($ua=false) { } /* check Chrome compatible browser, using Chrome version */ - elseif (preg_match('/ Chrome\/([a-z0-9\.]*) (.*) (TwitterAndroid|LBBROWSER)/Ui', $ua, $matches)) { + elseif (preg_match('/ Chrome\/([a-z0-9\.]*) (.*)(TwitterAndroid|LBBROWSER|Iron|DSBrowser)/Ui', $ua, $matches)) { $rep = array('TwitterAndroid'=>'Twitter', 'LBBROWSER'=>'Liebao'); $infos = array_merge($infos, array( 'browser_title' => isset($rep[$matches[3]]) ? $rep[$matches[3]] : $matches[3], @@ -2041,8 +2036,8 @@ function client_getUAInfos($ua=false) { } /* check Chrome/Safari/Firefox/Explorer compatible browsers, to be tested before usual browsers */ - elseif (preg_match('/[ |\/](YaBrowser|Camino|OPR|IceDragon|Dragon|Comodo_Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|FBSV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|FocusiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|QwantBrowser|QwantBrowser Firefox|QwantMobile|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser|2345Explorer|Kinza|WebPositive|Avast|VivoBrowser|Slimjet|Cornowser|baiduboxapp|Mint Browser|EdgA|Edg|EdgiOS|AVG|Station|OPT|Waterfox|OppoBrowser|chromeframe|UR|QtWebEngine|handyCafeCln|Thunderbird|MxBrowser|mCent|PureBrowser|Valve Steam GameOverlay|Midori|HistoryHound|TO-Browser|K-Ninja|Kapiko|Kazehakase|eM Client|Mb2345Browser|LieBaoFast|Whale|ADG|Light|jp.co.yahoo.ipn.appli|HeyTapBrowser|HuaweiBrowser|OneNote|115Browser|Paparazzi!|rekonq|TaoBrowser|kioclient|DuckDuckGo|Xvast|Bunjalloo|Supermedium|SEMC-Browser|Surf|WebClip|Snapchat|Fluid|Ionic|1Password|PHX|AOL|Quark|Reeder)\/([a-z0-9\._]*)?/i', $ua, $matches)) { - $rep = array('OPR'=>'Opera', 'CriOS'=>'Chrome', 'Comodo_Dragon'=>'Dragon', 'NS8'=>'Netscape', 'Firebird'=>'Thunderbird', 'FBAV'=>'Facebook App', 'FBSV'=>'Facebook App', 'app-ipad-CoteMaison'=>'Côté Maison App', 'amaya'=>'Amaya', 'MMS'=>'Opera Neon', 'ACHEETAHI'=>'CM Browser', 'OPiOS'=>'Opera mini', 'Focus'=>'Firefox Focus', 'GSA'=>'Google Search App', 'NG'=>'Browser NG', 'FxiOS'=>'Firefox', 'FocusiOS'=>'Firefox Focus', 'Lotus-Notes'=>'Lotus Notes', 'QwantiOS'=>'Qwant', 'QwantBrowser'=>'Qwant', 'QwantBrowser Firefox'=>'Qwant', 'QwantMobile' => 'Qwant', 'Blazer'=> 'Palm Blazer', 'SailfishBrowser' => 'Sailfish Browser', 'coc_coc_browser'=>'Côc côc', 'MZBrowser' => 'Meizu Browser', 'Avast' => 'Avast Browser', 'VivoBrowser' => 'Vivo Browser', 'baiduboxapp' => 'Baidu Search App', 'EdgA' => 'Edge', 'Edg' => 'Edge', 'EdgiOS'=>'Edge', 'AVG'=>'AVG Secure Browser', 'OPT'=>'Opera Touch', 'chromeframe'=>'Internet Explorer/Chrome Frame', 'UR'=>'UR Browser', 'QtWebEngine'=>'QtWebEngine based browser', 'handyCafeCln'=>'HandyCafe', 'TO-Browser'=>'t-online.de Browser', 'K-Ninja'=>'K-Ninja Samourai', 'Mb2345Browser'=>'2345 Browser', 'ADG'=>'AOL Desktop', 'jp.co.yahoo.ipn.appli'=>'Yahoo Japan App', 'HeyTapBrowser'=>'HeyTap Browser', 'HuaweiBrowser'=>'Huawei Browser', 'rekonq'=>'Rekonq', 'kioclient'=>'KIO Client', 'PHX'=>'Phoenix', 'AOL'=>'AOL Exporer'); + elseif (preg_match('/[ |\/](YaBrowser|Camino|OPR|IceDragon|Dragon|Comodo_Dragon|CriOS|Adventurer|Sleipnir|BoBrowser|Dolfin|ChromePlus|Phoenix|Shiretoko|NS8|MiuiBrowser|SamsungBrowser\/CrossApp|SamsungBrowser|Vivaldi|Qt|Iceweasel|Puffin|Firebird|FBAV|FBSV|app-ipad-CoteMaison|QQBrowser|PaleMoon|Arora|Edge|Cheshire|Getter|Dooble|amaya|Roccat|QupZilla|MMS|Iron|ACHEETAHI|OPiOS|Beonex|LibertyBrowser|LinkedIn|SeaMonkey|Cyberfox|Focus|Fennec|K-Meleon|CoolNovo|QuickLook|GSA|Electron|NG|FxiOS|FocusiOS|Lotus-Notes|Chimera|Epiphany|Iridium|HeadlessChrome|QwantiOS|QwantBrowser|QwantBrowser Firefox|QwantMobile|Blazer|TenFourFox|Silk|SailfishBrowser|coc_coc_browser|MZBrowser|2345Explorer|Kinza|WebPositive|Avast|VivoBrowser|Slimjet|Cornowser|baiduboxapp|Mint Browser|EdgA|Edg|EdgiOS|AVG|Station|OPT|Waterfox|OppoBrowser|chromeframe|UR|QtWebEngine|handyCafeCln|Thunderbird|MxBrowser|mCent|PureBrowser|Valve Steam GameOverlay|Midori|HistoryHound|TO-Browser|K-Ninja|Kapiko|Kazehakase|eM Client|Mb2345Browser|LieBaoFast|Whale|ADG|Light|jp.co.yahoo.ipn.appli|HeyTapBrowser|HuaweiBrowser|OneNote|115Browser|Paparazzi!|rekonq|TaoBrowser|kioclient|DuckDuckGo|Xvast|Bunjalloo|Supermedium|SEMC-Browser|Surf|WebClip|Snapchat|Fluid|Ionic|1Password|PHX|AOL|Quark|Reeder|Polypane|AlohaBrowser)\/([a-z0-9\._]*)?/i', $ua, $matches)) { + $rep = array('OPR'=>'Opera', 'CriOS'=>'Chrome', 'Comodo_Dragon'=>'Dragon', 'NS8'=>'Netscape', 'Firebird'=>'Thunderbird', 'FBAV'=>'Facebook App', 'FBSV'=>'Facebook App', 'app-ipad-CoteMaison'=>'Côté Maison App', 'amaya'=>'Amaya', 'MMS'=>'Opera Neon', 'ACHEETAHI'=>'CM Browser', 'OPiOS'=>'Opera mini', 'Focus'=>'Firefox Focus', 'GSA'=>'Google Search App', 'NG'=>'Browser NG', 'FxiOS'=>'Firefox', 'FocusiOS'=>'Firefox Focus', 'Lotus-Notes'=>'Lotus Notes', 'QwantiOS'=>'Qwant', 'QwantBrowser'=>'Qwant', 'QwantBrowser Firefox'=>'Qwant', 'QwantMobile' => 'Qwant', 'Blazer'=> 'Palm Blazer', 'SailfishBrowser' => 'Sailfish Browser', 'coc_coc_browser'=>'Côc côc', 'MZBrowser' => 'Meizu Browser', 'Avast' => 'Avast Browser', 'VivoBrowser' => 'Vivo Browser', 'baiduboxapp' => 'Baidu Search App', 'EdgA' => 'Edge', 'Edg' => 'Edge', 'EdgiOS'=>'Edge', 'AVG'=>'AVG Secure Browser', 'OPT'=>'Opera Touch', 'chromeframe'=>'Internet Explorer/Chrome Frame', 'UR'=>'UR Browser', 'QtWebEngine'=>'QtWebEngine based browser', 'handyCafeCln'=>'HandyCafe', 'TO-Browser'=>'t-online.de Browser', 'K-Ninja'=>'K-Ninja Samourai', 'Mb2345Browser'=>'2345 Browser', 'ADG'=>'AOL Desktop', 'jp.co.yahoo.ipn.appli'=>'Yahoo Japan App', 'HeyTapBrowser'=>'HeyTap Browser', 'HuaweiBrowser'=>'Huawei Browser', 'rekonq'=>'Rekonq', 'kioclient'=>'KIO Client', 'PHX'=>'Phoenix', 'AOL'=>'AOL Exporer', 'AlohaBrowser'=>'Aloha Browser'); $infos = array_merge($infos, array( 'browser_title' => isset($rep[$matches[1]]) ? $rep[$matches[1]] : $matches[1], 'browser_version' => isset($matches[2]) ? $matches[2] : '', @@ -2050,7 +2045,7 @@ function client_getUAInfos($ua=false) { } /* check no version written browser */ - elseif (preg_match('/(HeadlessChrome|Iron|Advanced Browser|Magic Browser|Pinterest|Sunrise|Keepsafe Browser|LBBROWSER|WebexTeams|wpif)/Ui', $ua, $matches)) { + elseif (preg_match('/(HeadlessChrome|Advanced Browser|Magic Browser|Pinterest|Sunrise|Keepsafe Browser|LBBROWSER|WebexTeams|wpif)/Ui', $ua, $matches)) { $rep = array('LBBROWSER'=>'Liebao', 'WebexTeams'=>'Webex Teams'); $infos = array_merge($infos, array( 'browser_title' => isset($rep[$matches[1]])?$rep[$matches[1]]:$matches[1], @@ -2120,6 +2115,7 @@ function client_getUAInfos($ua=false) { ); } + /* check OmniWeb, before safari */ elseif (preg_match('/OmniWeb\/v?([^ \.]+)/', $ua, $matches)) { $versions = array('622' => '5.9', '626' => '5.11', '630' => '6'); @@ -3053,6 +3049,10 @@ function client_getFakeInfosFromUserAgent($ua='') { if (preg_match('#(Gecko|Safari/537.36)/(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])([a-zA-Z0-9_]+)\-[0-9]$#', $ua)) return $fake; + /* Fake UA : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 lQHGDnYu-22 Firefox/80.0 */ + if (preg_match('#Gecko/20100101 ([a-zA-Z]{8}\-[0-9]{2}) Firefox/([0-9\.]{4,})$#', $ua)) + return $fake; + /* default result */ return false; } @@ -3129,13 +3129,13 @@ function _client_loadSoftwareProperties() { ), 'browser' => array( 'Firefox' => array( - 'MaxVersion' => '90', // current is 82, nightly is +6 + 'MaxVersion' => '93', // current is 85 , nightly is +6 'FakeVersions' => array('27.3', '45.62.15', '52.53.90'), 'HasNoVersion' => false, 'CheckMethod' => '_client_checkFirefoxIsFake', ), 'Chrome' => array( - 'MaxVersion' => '93', // current is 87 + 'MaxVersion' => '94', // current is 88 'FakeVersions' => array(), 'HasNoVersion' => true, 'CheckMethod' => '', @@ -3147,7 +3147,7 @@ function _client_loadSoftwareProperties() { 'CheckMethod' => '', ), 'Opera' => array( - 'MaxVersion' => '78', // current is 72 + 'MaxVersion' => '79', // current is 73 'FakeVersions' => array(), 'HasNoVersion' => false, 'CheckMethod' => '', diff --git a/engine/lib/tool/clientBots/Bots.php.inc b/engine/lib/tool/clientBots/Bots.php.inc index d7c639fb..b86f7013 100755 --- a/engine/lib/tool/clientBots/Bots.php.inc +++ b/engine/lib/tool/clientBots/Bots.php.inc @@ -3,10 +3,10 @@ * @brief Bots as client bots specific methods * @details Engine / Bot Library * @author CaMykS Team - * @version 1.0.75 + * @version 1.0.76 * @date Creation: May 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -4983,6 +4983,36 @@ function _client_getKnownBots() { 'engine_url' => 'https://thehive.ai', ); + /* PR-CY.RU bot */ + $knownBots['pr-cy.ru'] = array( + 'platform_type' => 'bot', + 'platform_format' => 'desktop', + 'bot_title' => '', + 'bot_url' => '', + 'engine_title' => 'PR•CY', + 'engine_url' => 'https://a.pr-cy.ru', + ); + + /* WhizeBot */ + $knownBots['whizebot'] = array( + 'platform_type' => 'bot', + 'platform_format' => 'desktop', + 'bot_title' => 'WhizeBot', + 'bot_url' => '', + 'engine_title' => 'Whize', + 'engine_url' => 'https://whize.co', + ); + + /* MTRobot */ + $knownBots['mtrobot'] = array( + 'platform_type' => 'bot', + 'platform_format' => 'desktop', + 'bot_title' => 'Metrics Tools Analytics Crawler', + 'bot_url' => 'https://metrics-tools.de/robot.html', + 'engine_title' => 'Metrics Tools', + 'engine_url' => 'https://metrics-tools.de/', + ); + /* Return bot list */ return $knownBots; } diff --git a/engine/lib/tool/clientBots/Generics.php.inc b/engine/lib/tool/clientBots/Generics.php.inc index b879e698..e88a780c 100755 --- a/engine/lib/tool/clientBots/Generics.php.inc +++ b/engine/lib/tool/clientBots/Generics.php.inc @@ -3,10 +3,10 @@ * @brief Generic libraries as client bots specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.24 + * @version 1.0.25 * @date Creation: May 2018 - * @date Modification: Oct 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -862,6 +862,16 @@ function _client_getKnownGenericsL2() { 'engine_url' => '', ); + /* GRequests */ + $knownGenerics['grequests'] = array( + 'platform_type' => 'tool', + 'platform_format' => 'desktop', + 'tool_title' => 'GRequests', + 'tool_url' => 'https://pypi.org/project/grequests/', + 'engine_title' => '', + 'engine_url' => '', + ); + /* obot */ $knownGenerics[' obot'] = array( 'platform_type' => 'bot', diff --git a/engine/lib/tool/clientBots/Tools.php.inc b/engine/lib/tool/clientBots/Tools.php.inc index 025d1655..96df6aae 100755 --- a/engine/lib/tool/clientBots/Tools.php.inc +++ b/engine/lib/tool/clientBots/Tools.php.inc @@ -2,12 +2,11 @@ /** * @brief Tools as client bots specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientBots/Tools.php.inc * @author CaMykS Team - * @version 1.0.29 + * @version 1.0.30 * @date Creation: May 2018 - * @date Modification: Sep 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -1342,6 +1341,16 @@ function _client_getKnownTools() { 'engine_url' => 'https://securitytxt.org/', ); + /* SiteSucker */ + $knownTools['sitesucker'] = array( + 'platform_type' => 'tool', + 'platform_format' => 'desktop', + 'tool_title' => '', + 'tool_url' => '', + 'engine_title' => 'SiteSucker', + 'engine_url' => 'https://ricks-apps.com/index.html', + ); + /* return list */ return $knownTools; } diff --git a/engine/lib/tool/clientBots/Unknowns.php.inc b/engine/lib/tool/clientBots/Unknowns.php.inc index f70ec28c..0e39d966 100755 --- a/engine/lib/tool/clientBots/Unknowns.php.inc +++ b/engine/lib/tool/clientBots/Unknowns.php.inc @@ -3,10 +3,10 @@ * @brief Unknown bots as client bots specific methods * @details Engine / Bot Library * @author CaMykS Team - * @version 1.0.28 + * @version 1.0.29 * @date Creation: Jan 2019 - * @date Modification: Nov 2020 - * @copyright 2019 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2019 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -798,6 +798,26 @@ function _client_getKnownUnknowns() { 'engine_url' => '', ); + /* TestBot */ + $unknownBots['testbot'] = array( + 'platform_type' => 'bot', + 'platform_format' => 'desktop', + 'bot_title' => 'TestBot (Unknown bot)', + 'bot_url' => '', + 'engine_title' => '', + 'engine_url' => '', + ); + + /* Crawler Test */ + $unknownBots['crawler test'] = array( + 'platform_type' => 'bot', + 'platform_format' => 'desktop', + 'bot_title' => 'Crawler Test (Unknown bot)', + 'bot_url' => '', + 'engine_title' => '', + 'engine_url' => '', + ); + /* return bot list */ return $unknownBots; } diff --git a/engine/lib/tool/clientDevices/Alcatel.php.inc b/engine/lib/tool/clientDevices/Alcatel.php.inc index 66d102e9..ee130877 100755 --- a/engine/lib/tool/clientDevices/Alcatel.php.inc +++ b/engine/lib/tool/clientDevices/Alcatel.php.inc @@ -3,10 +3,10 @@ * @brief Alcatel client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.13 + * @version 1.0.14 * @date Creation: Apr 2018 - * @date Modification: Oct 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -49,6 +49,7 @@ function get_AlcatelClientDevice($deviceCode='') { '4032X' => array('platform_model' => 'OneTouch Pop C2', 'platform_year' => 2015), '4033X' => array('platform_model' => 'OneTouch Pop C3', 'platform_year' => 2013), '4034D' => array('platform_model' => 'Pixi 4', 'platform_year' => 2016), + '4055U' => array('platform_model' => 'U3', 'platform_year' => 2017), '5003D' => array('platform_model' => 'C1', 'platform_year' => 2019), '5010E' => array('platform_model' => 'Pixi 4', 'platform_year' => 2016), '5015D' => array('platform_model' => 'OneTouch Pop 3', 'platform_year' => 2015), diff --git a/engine/lib/tool/clientDevices/Apple.php.inc b/engine/lib/tool/clientDevices/Apple.php.inc index 77aad4c5..13813491 100755 --- a/engine/lib/tool/clientDevices/Apple.php.inc +++ b/engine/lib/tool/clientDevices/Apple.php.inc @@ -2,12 +2,11 @@ /** * @brief Apple client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Apple.php.inc * @author CaMykS Team - * @version 1.0.2.1 + * @version 1.0.3 * @date Creation: Jul 2018 - * @date Modification: Jul 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -21,37 +20,45 @@ function get_AppleClientDevice($deviceCode='') { $deviceList = array( /* iPhones */ - 'iPhone1.1' => array('platform_model' => 'iPhone', 'platform_year' => 2007), - 'iPhone1.2' => array('platform_model' => 'iPhone 3G', 'platform_year' => 2008), - 'iPhone2.1' => array('platform_model' => 'iPhone 3GS', 'platform_year' => 2009), - 'iPhone3.1' => array('platform_model' => 'iPhone 4', 'platform_year' => 2010), - 'iPhone3.2' => array('platform_model' => 'iPhone 4', 'platform_year' => 2010), - 'iPhone3.3' => array('platform_model' => 'iPhone 4', 'platform_year' => 2010), - 'iPhone4.1' => array('platform_model' => 'iPhone 4S', 'platform_year' => 2011), - 'iPhone5.1' => array('platform_model' => 'iPhone 5', 'platform_year' => 2012), - 'iPhone5.2' => array('platform_model' => 'iPhone 5', 'platform_year' => 2012), - 'iPhone5.3' => array('platform_model' => 'iPhone 5C', 'platform_year' => 2013), - 'iPhone6.1' => array('platform_model' => 'iPhone 5S', 'platform_year' => 2013), - 'iPhone6.2' => array('platform_model' => 'iPhone 5S', 'platform_year' => 2013), - 'iPhone7.1' => array('platform_model' => 'iPhone 6 Plus', 'platform_year' => 2014), - 'iPhone7.2' => array('platform_model' => 'iPhone 6', 'platform_year' => 2014), - 'iPhone8.1' => array('platform_model' => 'iPhone 6S ', 'platform_year' => 2015), - 'iPhone8.2' => array('platform_model' => 'iPhone 6S Plus', 'platform_year' => 2015), - 'iPhone8.4' => array('platform_model' => 'iPhone SE', 'platform_year' => 2016), - 'iPhone9.1' => array('platform_model' => 'iPhone 7', 'platform_year' => 2016), - 'iPhone9.3' => array('platform_model' => 'iPhone 7', 'platform_year' => 2016), - 'iPhone9.2' => array('platform_model' => 'iPhone 7 Plus', 'platform_year' => 2016), - 'iPhone9.4' => array('platform_model' => 'iPhone 7 Plus', 'platform_year' => 2016), - 'iPhone10.1' => array('platform_model' => 'iPhone 8', 'platform_year' => 2017), - 'iPhone10.4' => array('platform_model' => 'iPhone 8', 'platform_year' => 2017), - 'iPhone10.2' => array('platform_model' => 'iPhone 8 Plus', 'platform_year' => 2017), - 'iPhone10.5' => array('platform_model' => 'iPhone 8 Plus', 'platform_year' => 2017), - 'iPhone10.3' => array('platform_model' => 'iPhone X', 'platform_year' => 2017), - 'iPhone10.6' => array('platform_model' => 'iPhone X', 'platform_year' => 2017), - 'iPhone11.2' => array('platform_model' => 'iPhone XS', 'platform_year' => 2018), - 'iPhone11.4' => array('platform_model' => 'iPhone XS Max', 'platform_year' => 2018), - 'iPhone11.6' => array('platform_model' => 'iPhone XS Max', 'platform_year' => 2018), - 'iPhone11.8' => array('platform_model' => 'iPhone XR', 'platform_year' => 2018), + 'iPhone1.1' => array('platform_model' => 'iPhone', 'platform_year' => 2007), + 'iPhone1.2' => array('platform_model' => 'iPhone 3G', 'platform_year' => 2008), + 'iPhone2.1' => array('platform_model' => 'iPhone 3GS', 'platform_year' => 2009), + 'iPhone3.1' => array('platform_model' => 'iPhone 4', 'platform_year' => 2010), + 'iPhone3.2' => array('platform_model' => 'iPhone 4', 'platform_year' => 2010), + 'iPhone3.3' => array('platform_model' => 'iPhone 4', 'platform_year' => 2010), + 'iPhone4.1' => array('platform_model' => 'iPhone 4S', 'platform_year' => 2011), + 'iPhone5.1' => array('platform_model' => 'iPhone 5', 'platform_year' => 2012), + 'iPhone5.2' => array('platform_model' => 'iPhone 5', 'platform_year' => 2012), + 'iPhone5.3' => array('platform_model' => 'iPhone 5C', 'platform_year' => 2013), + 'iPhone6.1' => array('platform_model' => 'iPhone 5S', 'platform_year' => 2013), + 'iPhone6.2' => array('platform_model' => 'iPhone 5S', 'platform_year' => 2013), + 'iPhone7.1' => array('platform_model' => 'iPhone 6 Plus', 'platform_year' => 2014), + 'iPhone7.2' => array('platform_model' => 'iPhone 6', 'platform_year' => 2014), + 'iPhone8.1' => array('platform_model' => 'iPhone 6S ', 'platform_year' => 2015), + 'iPhone8.2' => array('platform_model' => 'iPhone 6S Plus', 'platform_year' => 2015), + 'iPhone8.4' => array('platform_model' => 'iPhone SE', 'platform_year' => 2016), + 'iPhone9.1' => array('platform_model' => 'iPhone 7', 'platform_year' => 2016), + 'iPhone9.3' => array('platform_model' => 'iPhone 7', 'platform_year' => 2016), + 'iPhone9.2' => array('platform_model' => 'iPhone 7 Plus', 'platform_year' => 2016), + 'iPhone9.4' => array('platform_model' => 'iPhone 7 Plus', 'platform_year' => 2016), + 'iPhone10.1' => array('platform_model' => 'iPhone 8', 'platform_year' => 2017), + 'iPhone10.4' => array('platform_model' => 'iPhone 8', 'platform_year' => 2017), + 'iPhone10.2' => array('platform_model' => 'iPhone 8 Plus', 'platform_year' => 2017), + 'iPhone10.5' => array('platform_model' => 'iPhone 8 Plus', 'platform_year' => 2017), + 'iPhone10.3' => array('platform_model' => 'iPhone X', 'platform_year' => 2017), + 'iPhone10.6' => array('platform_model' => 'iPhone X', 'platform_year' => 2017), + 'iPhone11.2' => array('platform_model' => 'iPhone XS', 'platform_year' => 2018), + 'iPhone11.4' => array('platform_model' => 'iPhone XS Max', 'platform_year' => 2018), + 'iPhone11.6' => array('platform_model' => 'iPhone XS Max', 'platform_year' => 2018), + 'iPhone11.8' => array('platform_model' => 'iPhone XR', 'platform_year' => 2018), + 'iPhone12,1' => array('platform_model' => 'iPhone 11', 'platform_year' => 2019), + 'iPhone12,3' => array('platform_model' => 'iPhone 11 Pro', 'platform_year' => 2019), + 'iPhone12,5' => array('platform_model' => 'iPhone 11 Pro Max', 'platform_year' => 2019), + 'iPhone12,8' => array('platform_model' => 'iPhone SE', 'platform_year' => 2019), + 'iPhone13,1' => array('platform_model' => 'iPhone 12 Mini', 'platform_year' => 2020), + 'iPhone13,2' => array('platform_model' => 'iPhone 12', 'platform_year' => 2020), + 'iPhone13,3' => array('platform_model' => 'iPhone 12 Pro', 'platform_year' => 2020), + 'iPhone13,4' => array('platform_model' => 'iPhone 12 Pro Max', 'platform_year' => 2020), /* iPads */ 'iPad1.1' => array('platform_model' => 'iPad', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2010), @@ -69,6 +76,8 @@ function get_AppleClientDevice($deviceCode='') { 'iPad6.12' => array('platform_model' => 'iPad 5', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2017), 'iPad7.5' => array('platform_model' => 'iPad 6', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2018), 'iPad7.6' => array('platform_model' => 'iPad 6', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2018), + 'iPad7,11' => array('platform_model' => 'iPad 7', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), + 'iPad7,12' => array('platform_model' => 'iPad 7', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), /* iPads Pro */ 'iPad6.3' => array('platform_model' => 'iPad Pro (9.7\')', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2016), diff --git a/engine/lib/tool/clientDevices/Archos.php.inc b/engine/lib/tool/clientDevices/Archos.php.inc index 64667425..45e74428 100755 --- a/engine/lib/tool/clientDevices/Archos.php.inc +++ b/engine/lib/tool/clientDevices/Archos.php.inc @@ -3,10 +3,10 @@ * @brief Archos client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.16 + * @version 1.0.17 * @date Creation: Apr 2018 - * @date Modification: Nov 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -43,6 +43,7 @@ function get_ArchosClientDevice($deviceCode='') { '101b Xenon v2' => array('platform_model' => '101b Xenon', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2015), '101c Xenon' => array('platform_model' => '101c Xenon', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2017), '70 Oxygen' => array('platform_model' => '70 Oxygen', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2016), + '70b Copper' => array('platform_model' => '70b Copper', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2017), /* Archos phones */ 'A40TI' => array('platform_model' => '40 Titanium', 'platform_year' => 2013), diff --git a/engine/lib/tool/clientDevices/Asus.php.inc b/engine/lib/tool/clientDevices/Asus.php.inc index f834b831..d42e5916 100755 --- a/engine/lib/tool/clientDevices/Asus.php.inc +++ b/engine/lib/tool/clientDevices/Asus.php.inc @@ -3,10 +3,10 @@ * @brief Asus client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.33 + * @version 1.0.34 * @date Creation: Apr 2018 - * @date Modification: Nov 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -98,6 +98,7 @@ function get_AsusClientDevice($deviceCode='') { 'X00RD' => array('platform_model' => 'Zenfone Live L1', 'platform_year' => 2018), 'Z01RD' => array('platform_model' => 'Zenfone 5Z', 'platform_year' => 2018), 'I01WD' => array('platform_model' => 'Zenfone 6', 'platform_year' => 2019), + 'I002D' => array('platform_model' => 'Zenfone 7', 'platform_year' => 2020), /* Asus phones - ROG Phone series */ 'Z01QD' => array('platform_model' => 'ROG Phone', 'platform_year' => 2018), diff --git a/engine/lib/tool/clientDevices/Blackview.php.inc b/engine/lib/tool/clientDevices/Blackview.php.inc index eeeb49f6..60373716 100755 --- a/engine/lib/tool/clientDevices/Blackview.php.inc +++ b/engine/lib/tool/clientDevices/Blackview.php.inc @@ -3,10 +3,10 @@ * @brief Blackview client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.15 + * @version 1.0.16 * @date Creation: Jul 2018 - * @date Modification: Nov 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -31,6 +31,7 @@ function get_BlackviewClientDevice($deviceCode='') { 'BV5500Pro' => array('platform_model' => 'BV5500 Pro', 'platform_year' => 2019), 'BV5900' => array('platform_model' => 'BV5900', 'platform_year' => 2019), 'BV9500Plus' => array('platform_model' => 'BV9500 Plus', 'platform_year' => 2019), + 'BV9800' => array('platform_model' => 'BV9800', 'platform_year' => 2019), 'BV9800Pro' => array('platform_model' => 'BV9800 Pro', 'platform_year' => 2019), /* Blackview P series */ diff --git a/engine/lib/tool/clientDevices/Chuwi.php.inc b/engine/lib/tool/clientDevices/Chuwi.php.inc index 6834a1fd..f65d798a 100755 --- a/engine/lib/tool/clientDevices/Chuwi.php.inc +++ b/engine/lib/tool/clientDevices/Chuwi.php.inc @@ -2,12 +2,11 @@ /** * @brief Chuwi client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Chuwi.php.inc * @author CaMykS Team - * @version 1.0.0 + * @version 1.0.1 * @date Creation: Sep 2019 - * @date Modification: Sep 2019 - * @copyright 2019 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2019 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -22,6 +21,8 @@ function get_ChuwiClientDevice($deviceCode='') { $deviceList = array( /* Chuwi tablets */ 'Hi10 pro' => array('platform_model' => 'Hi10 Pro', 'platform_year' => 2016, 'platform_type' => 'tablet', 'platform_format' => 'tablet'), + 'Hi9Air' => array('platform_model' => 'Hi9 Air', 'platform_year' => 2019, 'platform_type' => 'tablet', 'platform_format' => 'tablet'), + ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Danew.php.inc b/engine/lib/tool/clientDevices/Danew.php.inc index 48b74889..7bfca579 100755 --- a/engine/lib/tool/clientDevices/Danew.php.inc +++ b/engine/lib/tool/clientDevices/Danew.php.inc @@ -2,12 +2,11 @@ /** * @brief Danew client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Danew.php.inc * @author CaMykS Team - * @version 1.0.0 + * @version 1.0.1 * @date Creation: Sep 2019 - * @date Modification: Sep 2019 - * @copyright 2019 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2019 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -25,6 +24,7 @@ function get_DanewClientDevice($deviceCode='') { /* Danew mobiles */ 'Konnect_601' => array('platform_model' => 'Konnect 601', 'platform_year' => 2017), + 'Konnect_607' => array('platform_model' => 'Konnect 607', 'platform_year' => 2019), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Doogee.php.inc b/engine/lib/tool/clientDevices/Doogee.php.inc index 93e39685..d5a86c3e 100755 --- a/engine/lib/tool/clientDevices/Doogee.php.inc +++ b/engine/lib/tool/clientDevices/Doogee.php.inc @@ -3,10 +3,10 @@ * @brief Doogee client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.13 + * @version 1.0.14 * @date Creation: Sep 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -30,7 +30,10 @@ function get_DoogeeClientDevice($deviceCode='') { 'X70' => array('platform_model' => 'X70', 'platform_year' => 2018), 'S55_Lite' => array('platform_model' => 'S55 Lite', 'platform_year' => 2018), 'S60Lite' => array('platform_model' => 'S60 Lite', 'platform_year' => 2018), + 'N20' => array('platform_model' => 'N20', 'platform_year' => 2019), 'S90' => array('platform_model' => 'S90', 'platform_year' => 2019), + 'N20Pro' => array('platform_model' => 'N20 Pro', 'platform_year' => 2020), + 'S58Pro' => array('platform_model' => 'S58 Pro', 'platform_year' => 2020), 'S88Pro' => array('platform_model' => 'S88 Pro', 'platform_year' => 2020), 'X95' => array('platform_model' => 'X95', 'platform_year' => 2020), ); diff --git a/engine/lib/tool/clientDevices/Huawei.php.inc b/engine/lib/tool/clientDevices/Huawei.php.inc index 6d425db9..ca555875 100755 --- a/engine/lib/tool/clientDevices/Huawei.php.inc +++ b/engine/lib/tool/clientDevices/Huawei.php.inc @@ -3,10 +3,10 @@ * @brief Huawei client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.84 + * @version 1.0.86 * @date Creation: Apr 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -89,6 +89,7 @@ function get_HuaweiClientDevices() { 'MAR-LX2' => array('platform_model' => 'P30 Lite', 'platform_year' => 2019), 'MAR-LX2J' => array('platform_model' => 'P30 Lite', 'platform_year' => 2019), 'MAR-LX3A' => array('platform_model' => 'P30 Lite', 'platform_year' => 2019), + 'MAR-LX3Am' => array('platform_model' => 'P30 Lite', 'platform_year' => 2019), 'VOG-L04' => array('platform_model' => 'P30 Pro', 'platform_year' => 2019), 'VOG-L09' => array('platform_model' => 'P30 Pro', 'platform_year' => 2019), 'VOG-L29' => array('platform_model' => 'P30 Pro', 'platform_year' => 2019), @@ -104,6 +105,7 @@ function get_HuaweiClientDevices() { 'STK-LX1' => array('platform_model' => 'P Smart Z', 'platform_year' => 2019), 'STK-LX3' => array('platform_model' => 'P Smart Z', 'platform_year' => 2019), 'JNY-LX1' => array('platform_model' => 'P40 Lite', 'platform_year' => 2020), + 'ART-L29' => array('platform_model' => 'P40 Lite E', 'platform_year' => 2020), 'ART-L29N' => array('platform_model' => 'P40 Lite E', 'platform_year' => 2020), 'CDY-NX9A' => array('platform_model' => 'P40 Lite 5G', 'platform_year' => 2020), @@ -128,6 +130,7 @@ function get_HuaweiClientDevices() { 'BLA-L29S' => array('platform_model' => 'Mate 10 Pro', 'platform_year' => 2017), 'SNE-L21' => array('platform_model' => 'Mate 20 Lite', 'platform_year' => 2018), 'SNE-LX1' => array('platform_model' => 'Mate 20 Lite', 'platform_year' => 2018), + 'SNE-LX2' => array('platform_model' => 'Mate 20 Lite', 'platform_year' => 2018), 'HMA-L29' => array('platform_model' => 'Mate 20', 'platform_year' => 2018), 'LYA-AL00' => array('platform_model' => 'Mate 20 Pro', 'platform_year' => 2018), 'LYA-L09' => array('platform_model' => 'Mate 20 Pro', 'platform_year' => 2018), @@ -137,6 +140,7 @@ function get_HuaweiClientDevices() { 'EVR-N29' => array('platform_model' => 'Mate 20 X 5G', 'platform_year' => 2019), 'NEO-L29' => array('platform_model' => 'Mate RS', 'platform_year' => 2018), 'LIO-L29' => array('platform_model' => 'Mate 30 Pro', 'platform_year' => 2019), + 'LIO-AN00' => array('platform_model' => 'Mate 30 Pro', 'platform_year' => 2019), /* Huawei Honor series */ 'Che2-L11' => array('platform_model' => 'Honor 4X', 'platform_year' => 2014), @@ -156,6 +160,7 @@ function get_HuaweiClientDevices() { 'JMM-L22' => array('platform_model' => 'Honor 6C Pro', 'platform_year' => 2017), 'BLN-L21' => array('platform_model' => 'Honor 6X', 'platform_year' => 2017), 'PLK-L01' => array('platform_model' => 'Honor 7', 'platform_year' => 2015), + 'AUM-L29' => array('platform_model' => 'Honor 7A Pro', 'platform_year' => 2018), 'LND-L29' => array('platform_model' => 'Honor 7C', 'platform_year' => 2018), 'BND-L21' => array('platform_model' => 'Honor 7X', 'platform_year' => 2017), 'BND-L24' => array('platform_model' => 'Honor 7X', 'platform_year' => 2017), @@ -171,6 +176,9 @@ function get_HuaweiClientDevices() { 'KSA-LX9' => array('platform_model' => 'Honor 8S', 'platform_year' => 2020), 'JSN-L21' => array('platform_model' => 'Honor 8X', 'platform_year' => 2018), 'JSN-L22' => array('platform_model' => 'Honor 8X', 'platform_year' => 2018), + 'KNT-AL10' => array('platform_model' => 'Honor V8', 'platform_year' => 2016), + 'KNT-TL10' => array('platform_model' => 'Honor V8', 'platform_year' => 2016), + 'KNT-UL10' => array('platform_model' => 'Honor V8', 'platform_year' => 2016), 'STF-AL00' => array('platform_model' => 'Honor 9', 'platform_year' => 2017), 'STF-AL10' => array('platform_model' => 'Honor 9', 'platform_year' => 2017), 'STF-TL10' => array('platform_model' => 'Honor 9', 'platform_year' => 2017), @@ -180,10 +188,10 @@ function get_HuaweiClientDevices() { 'LLD-AL10' => array('platform_model' => 'Honor 9 Lite', 'platform_year' => 2017), 'LLD-AL20' => array('platform_model' => 'Honor 9I', 'platform_year' => 2018), 'COL-L29' => array('platform_model' => 'Honor 10', 'platform_year' => 2018), + 'HRY-AL00a' => array('platform_model' => 'Honor 10 Lite', 'platform_year' => 2018), 'HRY-LX1' => array('platform_model' => 'Honor 10 Lite', 'platform_year' => 2018), 'HRY-LX1MEB'=> array('platform_model' => 'Honor 10 Lite', 'platform_year' => 2018), 'DNN-LX9' => array('platform_model' => 'Honor 10X Lite', 'platform_year' => 2018), - 'AUM-L29' => array('platform_model' => 'Honor 7A Pro', 'platform_year' => 2018), 'COR-L29' => array('platform_model' => 'Honor Play', 'platform_year' => 2018), 'BKL-L09' => array('platform_model' => 'Honor View 10', 'platform_year' => 2018), 'BKL-L09S' => array('platform_model' => 'Honor View 10', 'platform_year' => 2018), @@ -197,17 +205,18 @@ function get_HuaweiClientDevices() { 'JAT-L41' => array('platform_model' => 'Honor Play 8A', 'platform_year' => 2019), /* Huawei Ascend series */ + 'U9201L' => array('platform_model' => 'Ascend P1', 'platform_year' => 2012), 'Y221-U03' => array('platform_model' => 'Ascend', 'platform_year' => 2014), 'Y520-U22' => array('platform_model' => 'Ascend', 'platform_year' => 2014), 'Y600-U151' => array('platform_model' => 'Ascend', 'platform_year' => 2014), 'G7-L01' => array('platform_model' => 'Ascend G7', 'platform_year' => 2014), - 'U9201L' => array('platform_model' => 'Ascend P1', 'platform_year' => 2012), 'Y520-U22' => array('platform_model' => 'Ascend Y520', 'platform_year' => 2014), 'Y530-U00' => array('platform_model' => 'Ascend Y530', 'platform_year' => 2014), 'Y600-U151' => array('platform_model' => 'Ascend Y600', 'platform_year' => 2014), 'MT7' => array('platform_model' => 'Ascend Mate 7', 'platform_year' => 2014), 'MT7-L09' => array('platform_model' => 'Ascend Mate 7', 'platform_year' => 2014), 'MT7-TL00' => array('platform_model' => 'Ascend Mate 7', 'platform_year' => 2014), + 'SC-UL10' => array('platform_model' => 'Ascend GX1', 'platform_year' => 2015), 'H1611' => array('platform_model' => 'Ascend XT', 'platform_year' => 2016), /* Huawei Y series */ diff --git a/engine/lib/tool/clientDevices/LG.php.inc b/engine/lib/tool/clientDevices/LG.php.inc index 37c1a99e..8b226754 100755 --- a/engine/lib/tool/clientDevices/LG.php.inc +++ b/engine/lib/tool/clientDevices/LG.php.inc @@ -3,10 +3,10 @@ * @brief LG client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.38 + * @version 1.0.40 * @date Creation: Apr 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -64,6 +64,7 @@ function get_LGClientDevice($deviceCode='') { 'H870' => array('platform_model' => 'G6', 'platform_year' => 2017), 'H870D' => array('platform_model' => 'G6', 'platform_year' => 2017), 'H870DS' => array('platform_model' => 'G6', 'platform_year' => 2017), + 'H872' => array('platform_model' => 'G6', 'platform_year' => 2017), 'H873' => array('platform_model' => 'G6', 'platform_year' => 2017), 'H918' => array('platform_model' => 'V20', 'platform_year' => 2018), 'H930' => array('platform_model' => 'V30', 'platform_year' => 2017), @@ -86,6 +87,7 @@ function get_LGClientDevice($deviceCode='') { 'M327' => array('platform_model' => 'X Charge', 'platform_year' => 2017), 'M400' => array('platform_model' => 'Stylus 3', 'platform_year' => 2017), 'M470' => array('platform_model' => 'Stylo 3 Plus', 'platform_year' => 2017), + 'MS210' => array('platform_model' => 'Aristo', 'platform_year' => 2017), 'P715' => array('platform_model' => 'Optimus L7 II', 'platform_year' => 2013), 'P875' => array('platform_model' => 'Optimus F5', 'platform_year' => 2013), 'P920' => array('platform_model' => 'Optimus 3D', 'platform_year' => 2011), @@ -97,13 +99,16 @@ function get_LGClientDevice($deviceCode='') { 'TP260' => array('platform_model' => 'K20 Plus', 'platform_year' => 2019), 'Q720' => array('platform_model' => 'Stylo 5', 'platform_year' => 2019), 'V405' => array('platform_model' => 'V40', 'platform_year' => 2018), + 'V409N' => array('platform_model' => 'V40', 'platform_year' => 2020), 'V600' => array('platform_model' => 'ThinQ 5G', 'platform_year' => 2020), + 'VS985' => array('platform_model' => 'G3', 'platform_year' => 2014), 'VS986' => array('platform_model' => 'G4', 'platform_year' => 2015), 'VS987' => array('platform_model' => 'G5', 'platform_year' => 2016), 'X210' => array('platform_model' => 'K7', 'platform_year' => 2016), 'X410' => array('platform_model' => 'K30', 'platform_year' => 2018), 'X410.F' => array('platform_model' => 'K11+', 'platform_year' => 2018), 'X420' => array('platform_model' => 'K40', 'platform_year' => 2019), + 'X520' => array('platform_model' => 'K50', 'platform_year' => 2019), 'X525' => array('platform_model' => 'Q60', 'platform_year' => 2019), ); diff --git a/engine/lib/tool/clientDevices/Leagoo.php.inc b/engine/lib/tool/clientDevices/Leagoo.php.inc index 1291b424..0c2671e5 100755 --- a/engine/lib/tool/clientDevices/Leagoo.php.inc +++ b/engine/lib/tool/clientDevices/Leagoo.php.inc @@ -2,12 +2,11 @@ /** * @brief Leagoo client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Leagoo.php.inc * @author CaMykS Team - * @version 1.0.2 + * @version 1.0.3 * @date Creation: Jan 2019 - * @date Modification: Jul 2020 - * @copyright 2019 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2019 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -47,7 +46,8 @@ function get_LeagooClientDevice($deviceCode='') { 'Lead 6' => array('platform_year' => 2015), 'Lead 7' => array('platform_year' => 2015), - 'S8_Pro' => array('platform_model' => 'S8 Pro', 'platform_year' => 2017), + 'S8_Pro' => array('platform_model' => 'S8 Pro', 'platform_year' => 2017), + 'Z6' => array('platform_model' => 'Z6', 'platform_year' => 2017), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Lenovo.php.inc b/engine/lib/tool/clientDevices/Lenovo.php.inc index 7b12c117..67e956ab 100755 --- a/engine/lib/tool/clientDevices/Lenovo.php.inc +++ b/engine/lib/tool/clientDevices/Lenovo.php.inc @@ -2,12 +2,11 @@ /** * @brief Lenovo client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Lenovo.php.inc * @author CaMykS Team - * @version 1.0.28 + * @version 1.0.30 * @date Creation: Apr 2018 - * @date Modification: Sep 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -43,7 +42,13 @@ function get_LenovoClientDevice($deviceCode='') { 'TB3-850F' => array('platform_model' => 'Tab 3 8\'', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2017), 'TB-8703F' => array('platform_model' => 'Tab 3 8 Plus', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2017), 'TB-X304F' => array('platform_model' => 'Tab 4', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2017), + 'TB-X104F' => array('platform_model' => 'Tab E10', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2018), + 'TB-X104F1' => array('platform_model' => 'Tab E10', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2018), + 'TB-X104L' => array('platform_model' => 'Tab E10', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2018), + 'TB-X104X' => array('platform_model' => 'Tab E10', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2018), + 'TB-X505F' => array('platform_model' => 'Tab M10', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), 'TB-X605F' => array('platform_model' => 'Tab M10', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), + 'TB-X606F' => array('platform_model' => 'Tab M10 Plus', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), /* Lenovo phones */ 'A369i' => array('platform_model' => 'A369i', 'platform_year' => 2013), @@ -82,8 +87,10 @@ function get_LenovoClientDevice($deviceCode='') { 'Z1' => array('platform_model' => 'Zuk Z1', 'platform_year' => 2015), 'Z2131' => array('platform_model' => 'Zuk Z2', 'platform_year' => 2016), 'Z2151' => array('platform_model' => 'Zuk Edge', 'platform_year' => 2017), + 'K520' => array('platform_model' => 'S5', 'platform_year' => 2019), 'Z2 Plus' => array('platform_year' => 2017), + ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Nokia.php.inc b/engine/lib/tool/clientDevices/Nokia.php.inc index ae67bfd0..05c8ddfe 100755 --- a/engine/lib/tool/clientDevices/Nokia.php.inc +++ b/engine/lib/tool/clientDevices/Nokia.php.inc @@ -3,10 +3,10 @@ * @brief Nokia client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.27 + * @version 1.0.28 * @date Creation: Jun 2018 - * @date Modification: Nov 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -27,6 +27,7 @@ function get_NokiaClientDevice($deviceCode='') { 'Lumia 735' => array('platform_model' => 'Lumia 735', 'platform_year' => 2014), 'Lumia 830' => array('platform_model' => 'Lumia 830', 'platform_year' => 2014), 'Lumia 830' => array('platform_model' => 'Lumia 830', 'platform_year' => 2014), + 'Lumia 1520' => array('platform_model' => 'Lumia 1520', 'platform_year' => 2014), 'Lumia 950 XL' => array('platform_model' => 'Lumia 950 XL', 'platform_year' => 2015), 'Lumia 640' => array('platform_model' => 'Lumia 640', 'platform_year' => 2015), 'Lumia 640 LTE' => array('platform_model' => 'Lumia 640 LTE', 'platform_year' => 2015), diff --git a/engine/lib/tool/clientDevices/Oppo.php.inc b/engine/lib/tool/clientDevices/Oppo.php.inc index 7a65a3c7..876de6cf 100755 --- a/engine/lib/tool/clientDevices/Oppo.php.inc +++ b/engine/lib/tool/clientDevices/Oppo.php.inc @@ -3,10 +3,10 @@ * @brief Oppo client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.34 + * @version 1.0.36 * @date Creation: Nov 2018 - * @date Modification: Nov 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -29,6 +29,8 @@ function get_OppoClientDevice($deviceCode='') { 'A37fw' => array('platform_model' => 'A37fw', 'platform_year' => 2017), 'CPH1609' => array('platform_model' => 'F3', 'platform_year' => 2017), 'CPH1613' => array('platform_model' => 'F3 Plus', 'platform_year' => 2017), + 'CPH1715' => array('platform_model' => 'A77', 'platform_year' => 2017), + 'CPH1725' => array('platform_model' => 'F5 Youth', 'platform_year' => 2017), 'CPH1727' => array('platform_model' => 'F5', 'platform_year' => 2017), 'CPH1729' => array('platform_model' => 'A83', 'platform_year' => 2017), 'CPH1837' => array('platform_model' => 'A3', 'platform_year' => 2018), @@ -59,6 +61,7 @@ function get_OppoClientDevice($deviceCode='') { 'CPH2021' => array('platform_model' => 'A91', 'platform_year' => 2020), 'CPH2025' => array('platform_model' => 'X2 Pro', 'platform_year' => 2020), 'CPH2059' => array('platform_model' => 'A92', 'platform_year' => 2020), + 'CPH2065' => array('platform_model' => 'Reno 4 Z', 'platform_year' => 2020), 'CPH2067' => array('platform_model' => 'A72', 'platform_year' => 2020), ); diff --git a/engine/lib/tool/clientDevices/Orange.php.inc b/engine/lib/tool/clientDevices/Orange.php.inc index 5cd38130..ad116482 100755 --- a/engine/lib/tool/clientDevices/Orange.php.inc +++ b/engine/lib/tool/clientDevices/Orange.php.inc @@ -2,12 +2,11 @@ /** * @brief Orange client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Orange.php.inc * @author CaMykS Team - * @version 1.0.4 + * @version 1.0.5 * @date Creation: Sep 2018 - * @date Modification: Mar 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -34,6 +33,7 @@ function get_OrangeClientDevice($deviceCode='') { 'Rise52' => array('platform_model' => 'Rise 52', 'platform_year' => 2017), 'Rise 54' => array('platform_model' => 'Rise 54', 'platform_year' => 2018), 'Neva play' => array('platform_model' => 'Neva play', 'platform_year' => 2019), + 'Neva start' => array('platform_model' => 'Neva start', 'platform_year' => 2019), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Realme.php.inc b/engine/lib/tool/clientDevices/Realme.php.inc index 2b5b0cfd..50297553 100644 --- a/engine/lib/tool/clientDevices/Realme.php.inc +++ b/engine/lib/tool/clientDevices/Realme.php.inc @@ -3,10 +3,10 @@ * @brief Realme (Oppo subsidiary) client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.5 + * @version 1.0.6 * @date Creation: Apr 2020 - * @date Modification: Nov 2020 - * @copyright 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -31,7 +31,7 @@ function get_RealmeClientDevice($deviceCode='') { 'RMX1993' => array('platform_model' => 'X2', 'platform_year' => 2019), 'RMX2001' => array('platform_model' => '6', 'platform_year' => 2020), 'RMX2027' => array('platform_model' => 'C3', 'platform_year' => 2020), - 'RMX2027' => array('platform_model' => 'C3', 'platform_year' => 2020), + 'RMX2030' => array('platform_model' => '5i', 'platform_year' => 2020), 'RMX2061' => array('platform_model' => '6 Pro', 'platform_year' => 2020), 'RMX2075' => array('platform_model' => 'X50 Pro', 'platform_year' => 2020), 'RMX2185' => array('platform_model' => 'C11', 'platform_year' => 2020), diff --git a/engine/lib/tool/clientDevices/Samsung.php.inc b/engine/lib/tool/clientDevices/Samsung.php.inc index c6a8dbe3..cdc1c396 100755 --- a/engine/lib/tool/clientDevices/Samsung.php.inc +++ b/engine/lib/tool/clientDevices/Samsung.php.inc @@ -3,10 +3,10 @@ * @brief Samsung client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.94 + * @version 1.0.96 * @date Creation: Apr 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -93,9 +93,12 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-T720' => array('platform_model' => 'Galaxy Tab S5e', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), 'SM-T725' => array('platform_model' => 'Galaxy Tab S5e', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), 'SM-T860' => array('platform_model' => 'Galaxy Tab S6', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), + 'SM-T865' => array('platform_model' => 'Galaxy Tab S6', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2019), + 'SM-T500' => array('platform_model' => 'Galaxy Tab A7 10.4', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), 'SM-T505' => array('platform_model' => 'Galaxy Tab A7 10.4', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), 'SM-P610' => array('platform_model' => 'Galaxy Tab S6 Light', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), 'SM-P615' => array('platform_model' => 'Galaxy Tab S6 Light', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), + 'SM-T870' => array('platform_model' => 'Galaxy Tab S7', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), 'SM-T875' => array('platform_model' => 'Galaxy Tab S7', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), 'SM-T970' => array('platform_model' => 'Galaxy Tab S7+', 'platform_type' => 'tablet', 'platform_format' => 'tablet', 'platform_year' => 2020), @@ -128,6 +131,7 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-G900W8' => array('platform_model' => 'Galaxy S5', 'platform_year' => 2014), 'SM-G901F' => array('platform_model' => 'Galaxy S5+', 'platform_year' => 2014), 'SM-G800F' => array('platform_model' => 'Galaxy S5 Mini', 'platform_year' => 2014), + 'SM-G870A' => array('platform_model' => 'Galaxy S5 Active', 'platform_year' => 2014), 'SM-G870F' => array('platform_model' => 'Galaxy S5 Active', 'platform_year' => 2014), 'SM-G903F' => array('platform_model' => 'Galaxy S5 Neo', 'platform_year' => 2015), 'SM-G903W' => array('platform_model' => 'Galaxy S5 Neo', 'platform_year' => 2015), @@ -202,7 +206,9 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-G975F' => array('platform_model' => 'Galaxy S10+', 'platform_year' => 2019), 'SM-G975U' => array('platform_model' => 'Galaxy S10+', 'platform_year' => 2019), 'SM-G975W' => array('platform_model' => 'Galaxy S10+', 'platform_year' => 2019), + 'SM-G977N' => array('platform_model' => 'Galaxy S10 5G', 'platform_year' => 2019), 'SM-G980F' => array('platform_model' => 'Galaxy S20', 'platform_year' => 2020), + 'SM-G9810' => array('platform_model' => 'Galaxy S20', 'platform_year' => 2020), 'SM-G981B' => array('platform_model' => 'Galaxy S20', 'platform_year' => 2020), 'SM-G985F' => array('platform_model' => 'Galaxy S20+', 'platform_year' => 2020), 'SM-G986B' => array('platform_model' => 'Galaxy S20+', 'platform_year' => 2020), @@ -213,6 +219,7 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-G988U' => array('platform_model' => 'Galaxy S20 Ultra', 'platform_year' => 2020), 'SM-G780F' => array('platform_model' => 'Galaxy S20 Fan Edition', 'platform_year' => 2020), 'SM-G781B' => array('platform_model' => 'Galaxy S20 Fan Edition', 'platform_year' => 2020), + 'SM-G998B' => array('platform_model' => 'Galaxy S21 Ultra', 'platform_year' => 2021), /* Samsung Galaxy A series */ 'SM-A260F' => array('platform_model' => 'Galaxy A2 Core', 'platform_year' => 2019), @@ -275,6 +282,7 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-A405FN' => array('platform_model' => 'Galaxy A40', 'platform_year' => 2019), 'SM-A3050' => array('platform_model' => 'Galaxy A40s', 'platform_year' => 2019), 'SM-A415F' => array('platform_model' => 'Galaxy A41', 'platform_year' => 2020), + 'SM-A426B' => array('platform_model' => 'Galaxy A42', 'platform_year' => 2020), 'SM-A505F' => array('platform_model' => 'Galaxy A50', 'platform_year' => 2019), 'SM-A505FN' => array('platform_model' => 'Galaxy A50', 'platform_year' => 2019), 'SM-A505G' => array('platform_model' => 'Galaxy A50', 'platform_year' => 2019), @@ -390,6 +398,7 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-M105G' => array('platform_model' => 'Galaxy M10', 'platform_year' => 2019), 'SM-M205F' => array('platform_model' => 'Galaxy M20', 'platform_year' => 2019), 'SM-M307F' => array('platform_model' => 'Galaxy M30s', 'platform_year' => 2019), + 'SM-M315F' => array('platform_model' => 'Galaxy M31', 'platform_year' => 2020), /* Samsung Galaxy Note series */ 'GT-N5110' => array('platform_model' => 'Galaxy Note', 'platform_year' => 2013), @@ -436,6 +445,7 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-N9500' => array('platform_model' => 'Galaxy Note 8', 'platform_year' => 2017), 'SM-N950F' => array('platform_model' => 'Galaxy Note 8', 'platform_year' => 2017), 'SM-N950N' => array('platform_model' => 'Galaxy Note 8', 'platform_year' => 2017), + 'SM-N950U' => array('platform_model' => 'Galaxy Note 8', 'platform_year' => 2017), 'SM-N950U1' => array('platform_model' => 'Galaxy Note 8', 'platform_year' => 2017), 'SM-N950W' => array('platform_model' => 'Galaxy Note 8', 'platform_year' => 2017), 'SM-N9600' => array('platform_model' => 'Galaxy Note 9', 'platform_year' => 2018), @@ -457,6 +467,7 @@ function get_SamsungClientDevice($deviceCode='') { /* Samsung Galaxy Fold series */ 'SM-F700F' => array('platform_model' => 'Galaxy Fold', 'platform_year' => 2019), + 'SM-F900F' => array('platform_model' => 'Galaxy Fold', 'platform_year' => 2019), 'SM-F916B' => array('platform_model' => 'Galaxy Z Fold2', 'platform_year' => 2020), /* Samsung Galaxy other series */ @@ -514,6 +525,7 @@ function get_SamsungClientDevice($deviceCode='') { 'SM-G389F' => array('platform_model' => 'Galaxy Xcover 3', 'platform_year' => 2015), 'SM-G390F' => array('platform_model' => 'Galaxy Xcover 4', 'platform_year' => 2017), 'SM-G398FN' => array('platform_model' => 'Galaxy Xcover 5', 'platform_year' => 2019), + 'SM-G715FN' => array('platform_model' => 'Galaxy Xcover Pro', 'platform_year' => 2020), 'GT-S5360' => array('platform_model' => 'Galaxy Y', 'platform_year' => 2011), 'GT-S6102' => array('platform_model' => 'Galaxy Y Duos', 'platform_year' => 2012), 'GT-S7582' => array('platform_model' => 'Galaxy S Duos', 'platform_year' => 2012), diff --git a/engine/lib/tool/clientDevices/Sharp.php.inc b/engine/lib/tool/clientDevices/Sharp.php.inc index 00e68537..c2e8dce2 100755 --- a/engine/lib/tool/clientDevices/Sharp.php.inc +++ b/engine/lib/tool/clientDevices/Sharp.php.inc @@ -2,12 +2,11 @@ /** * @brief Sharp client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Sharp.php.inc * @author CaMykS Team - * @version 1.0.5 + * @version 1.0.6 * @date Creation: May 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -23,6 +22,7 @@ function get_SharpClientDevice($deviceCode='') { 'SH-02H' => array('platform_model' => 'Aquos Compact', 'platform_year' => 2015), 'FS8002' => array('platform_model' => 'Z2', 'platform_year' => 2016), 'SHV39' => array('platform_model' => 'Aquos R', 'platform_year' => 2017), + 'SHV40' => array('platform_model' => 'Aquos Sense', 'platform_year' => 2017), 'FS8032' => array('platform_model' => 'Aquos S3', 'platform_year' => 2018), 'SH-D01' => array('platform_model' => 'Aquos D10', 'platform_year' => 2018), ); diff --git a/engine/lib/tool/clientDevices/Sony.php.inc b/engine/lib/tool/clientDevices/Sony.php.inc index 83bff81a..e7b91416 100755 --- a/engine/lib/tool/clientDevices/Sony.php.inc +++ b/engine/lib/tool/clientDevices/Sony.php.inc @@ -3,10 +3,10 @@ * @brief Sony client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.54 + * @version 1.0.55 * @date Creation: Apr 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -107,8 +107,9 @@ function get_SonyClientDevice($deviceCode='') { 'H4113' => array('platform_model' => 'Xperia XA2', 'platform_year' => 2018), 'H4133' => array('platform_model' => 'Xperia XA2', 'platform_year' => 2018), 'H4213' => array('platform_model' => 'Xperia XA2 Ultra', 'platform_year' => 2018), + 'H4233' => array('platform_model' => 'Xperia XA2 Ultra', 'platform_year' => 2018), 'H4413' => array('platform_model' => 'Xperia XA2 Plus', 'platform_year' => 2018), - 'H8166' => array('platform_model' => 'Xperia XZ2 Premium', 'platform_year' => 2018), + 'H8166' => array('platform_model' => 'Xperia XZ2 Premium', 'platform_year' => 2018), 'H8216' => array('platform_model' => 'Xperia XZ2', 'platform_year' => 2018), 'H8266' => array('platform_model' => 'Xperia XZ2', 'platform_year' => 2018), 'H8296' => array('platform_model' => 'Xperia XZ2', 'platform_year' => 2018), diff --git a/engine/lib/tool/clientDevices/Sumvier.php.inc b/engine/lib/tool/clientDevices/Sumvier.php.inc new file mode 100644 index 00000000..a806bd9d --- /dev/null +++ b/engine/lib/tool/clientDevices/Sumvier.php.inc @@ -0,0 +1,45 @@ + + * @version 1.0.0 + * @date Creation: Jan 2021 + * @date Modification: Jan 2021 + * @copyright 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * @warning This library is not loaded with CaMykS initialisation. + */ + +/** + * Return Sumvier client device information from a known list. + * @param mixed $deviceCode + * @return array + */ +function get_SumvierClientDevice($deviceCode='') { + $deviceList = array( + 'K41' => array('platform_model' => 'K41', 'platform_year' => '2015'), + ); + + /* Check for returning list */ + if ($deviceCode === false) + return $deviceList; + + /* Initialise result. */ + $result = array( + 'platform_company' => 'Sumvier', + 'platform_country' => 'cn', + 'platform_model' => $deviceCode, + 'platform_type' => 'handheld', + 'platform_format' => 'handheld', + ); + + /* Check if device is a known device. */ + if (!array_key_exists($deviceCode, $deviceList)) + return $result; + + /* Return result. */ + return array_merge($result, $deviceList[$deviceCode]); +} +?> diff --git a/engine/lib/tool/clientDevices/Teclast.php.inc b/engine/lib/tool/clientDevices/Teclast.php.inc index 0f08a249..a9aecdca 100644 --- a/engine/lib/tool/clientDevices/Teclast.php.inc +++ b/engine/lib/tool/clientDevices/Teclast.php.inc @@ -5,8 +5,8 @@ * @author CaMykS Team * @version 1.0.0 * @date Creation: Nov 2020 - * @date Modification: Nov 2020 - * @copyright 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -19,8 +19,9 @@ */ function get_TeclastClientDevice($deviceCode='') { $deviceList = array( - /* Teclast mobiles */ + /* Teclast tablets */ 'TLA002' => array('platform_model' => 'M30', 'platform_year' => 2019, 'platform_type' => 'tablet', 'platform_format' => 'tablet'), + 'M40_EEA' => array('platform_model' => 'M40', 'platform_year' => 2020, 'platform_type' => 'tablet', 'platform_format' => 'tablet'), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Tecno.php.inc b/engine/lib/tool/clientDevices/Tecno.php.inc index 130867ab..6eff2a7e 100755 --- a/engine/lib/tool/clientDevices/Tecno.php.inc +++ b/engine/lib/tool/clientDevices/Tecno.php.inc @@ -3,10 +3,10 @@ * @brief Tecno client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.26 + * @version 1.0.28 * @date Creation: Oct 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -25,16 +25,18 @@ function get_TecnoClientDevice($deviceCode='') { /* Tecno mobiles */ 'C9' => array('platform_model' => 'C9', 'platform_year' => 2016), 'J8' => array('platform_model' => 'Boom', 'platform_year' => 2016), + 'N9S' => array('platform_model' => 'N9S', 'platform_year' => 2016), 'W4' => array('platform_model' => 'W4', 'platform_year' => 2016), 'K7' => array('platform_model' => 'Spark', 'platform_year' => 2017), 'K9' => array('platform_model' => 'Spark Plus', 'platform_year' => 2017), - 'L9 Plus' => array('platform_model' => 'L9 Plus', 'platform_year' => 2017), + 'L9 Plus' => array('platform_model' => 'L9 Plus', 'platform_year' => 2017), 'R6' => array('platform_model' => 'R6', 'platform_year' => 2017), 'W3' => array('platform_model' => 'W3', 'platform_year' => 2017), 'W2' => array('platform_model' => 'W2', 'platform_year' => 2017), 'CF7' => array('platform_model' => 'Camon 11', 'platform_year' => 2018), 'CF8' => array('platform_model' => 'Camon 11 Pro', 'platform_year' => 2018), 'KA7' => array('platform_model' => 'Spark 2', 'platform_year' => 2018), + 'LA6' => array('platform_model' => 'Pouvoir 1', 'platform_year' => 2018), 'LA7' => array('platform_model' => 'Pouvoir 2', 'platform_year' => 2018), 'LA7 Pro' => array('platform_model' => 'Pouvoir 2 Pro', 'platform_year' => 2018), 'AX8' => array('platform_model' => 'Phantom 8', 'platform_year' => 2018), @@ -51,6 +53,7 @@ function get_TecnoClientDevice($deviceCode='') { 'KC8' => array('platform_model' => 'Spark 4', 'platform_year' => 2019), 'LB7' => array('platform_model' => 'Pouvoir 3', 'platform_year' => 2019), 'CC7' => array('platform_model' => 'Camon 12', 'platform_year' => 2019), + 'CC9' => array('platform_model' => 'Camon 12 Pro', 'platform_year' => 2019), 'CD8j' => array('platform_model' => 'Camon 15', 'platform_year' => 2019), 'BA2' => array('platform_model' => 'Pop 2 Plus', 'platform_year' => 2019), 'CD7' => array('platform_model' => 'Camon 15', 'platform_year' => 2020), @@ -59,6 +62,8 @@ function get_TecnoClientDevice($deviceCode='') { 'BC2' => array('platform_model' => 'Pop 4', 'platform_year' => 2020), 'LC7' => array('platform_model' => 'Pouvoir 4', 'platform_year' => 2020), 'LC8' => array('platform_model' => 'Pouvoir 4 Pro', 'platform_year' => 2020), + + 'Phantom6-Plus' => array('platform_model' => 'Phantom 6 Plus', 'platform_year' => 2016), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Ulefone.php.inc b/engine/lib/tool/clientDevices/Ulefone.php.inc index 51bcc59c..bb426958 100755 --- a/engine/lib/tool/clientDevices/Ulefone.php.inc +++ b/engine/lib/tool/clientDevices/Ulefone.php.inc @@ -2,12 +2,11 @@ /** * @brief Ulefone client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Ulefone.php.inc * @author CaMykS Team - * @version 1.0.7 + * @version 1.0.8 * @date Creation: Mar 2019 - * @date Modification: Sep 2020 - * @copyright 2019 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2019 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -27,6 +26,7 @@ function get_UlefoneClientDevice($deviceCode='') { 'armor x5' => array('platform_model' => 'Armor X5', 'platform_year' => 2019), 'armor_x6' => array('platform_model' => 'Armor X6', 'platform_year' => 2019), 'armor 7' => array('platform_model' => 'Armor 7', 'platform_year' => 2020), + 'armor 7e' => array('platform_model' => 'Armor 7E', 'platform_year' => 2020), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Unknown.php.inc b/engine/lib/tool/clientDevices/Unknown.php.inc new file mode 100644 index 00000000..6def042e --- /dev/null +++ b/engine/lib/tool/clientDevices/Unknown.php.inc @@ -0,0 +1,46 @@ + + * @version 1.0.0 + * @date Creation: Jan 2021 + * @date Modification: Jan 2021 + * @copyright 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * @warning This library is not loaded with CaMykS initialisation. + */ + +/** + * Return Unknown client device information from a known list. + * @param mixed $deviceCode + * @return array + */ +function get_UnknownClientDevice($deviceCode='') { + $deviceList = array( + 'Phh-Treble' => array('platform_model' => 'Flashed mobile with Phh-Treble generic ROM'), + 'Unspecified Device' => array('platform_model' => 'Unspecified Device'), + ); + + /* Check for returning list */ + if ($deviceCode === false) + return $deviceList; + + /* Initialise result. */ + $result = array( + 'platform_company' => '(Unknown)', + 'platform_country' => '', + 'platform_model' => $deviceCode, + 'platform_type' => 'handheld', + 'platform_format' => 'handheld', + ); + + /* Check if device is a known device. */ + if (!array_key_exists($deviceCode, $deviceList)) + return $result; + + /* Return result. */ + return array_merge($result, $deviceList[$deviceCode]); +} +?> diff --git a/engine/lib/tool/clientDevices/Vestel.php.inc b/engine/lib/tool/clientDevices/Vestel.php.inc index f2e1f8ce..5afd3bc1 100755 --- a/engine/lib/tool/clientDevices/Vestel.php.inc +++ b/engine/lib/tool/clientDevices/Vestel.php.inc @@ -2,12 +2,11 @@ /** * @brief Vestel client devices specific methods * @details Engine / Tool Library - * @file engine/lib/tool/clientDevices/Vestel.php.inc * @author CaMykS Team - * @version 1.0.1 + * @version 1.0.2 * @date Creation: Mar 2019 - * @date Modification: Jun 2019 - * @copyright 2019 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2019 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -20,7 +19,8 @@ */ function get_VestelClientDevice($deviceCode='') { $deviceList = array( - 'Venus_V3_5570'=> array('platform_model' => 'Venus V3 5570', 'platform_year' => 2015), + 'Venus_V3_5570' => array('platform_model' => 'Venus V3 5570', 'platform_year' => 2015), + 'Venus Z40' => array('platform_model' => 'Venus Z40', 'platform_year' => 2019), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Wiko.php.inc b/engine/lib/tool/clientDevices/Wiko.php.inc index aacc3a15..0ab3c247 100755 --- a/engine/lib/tool/clientDevices/Wiko.php.inc +++ b/engine/lib/tool/clientDevices/Wiko.php.inc @@ -3,10 +3,10 @@ * @brief Wiko client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.20 + * @version 1.0.21 * @date Creation: Jul 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -131,6 +131,7 @@ function get_WikoClientDevice($deviceCode='') { 'w-v730' => array('platform_model' => 'View 3', 'platform_year' => 2019), 'w-v830' => array('platform_model' => 'View 4', 'platform_year' => 2019), 'w-k560' => array('platform_model' => 'Y61', 'platform_year' => 2020), + 'w-v851' => array('platform_model' => 'View 5', 'platform_year' => 2020), ); /* Check for returning list */ diff --git a/engine/lib/tool/clientDevices/Xiaomi.php.inc b/engine/lib/tool/clientDevices/Xiaomi.php.inc index 3fde2f8d..e5246f60 100755 --- a/engine/lib/tool/clientDevices/Xiaomi.php.inc +++ b/engine/lib/tool/clientDevices/Xiaomi.php.inc @@ -3,10 +3,10 @@ * @brief Xiaomi client devices specific methods * @details Engine / Tool Library * @author CaMykS Team - * @version 1.0.48 + * @version 1.0.49 * @date Creation: May 2018 - * @date Modification: Dec 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @warning This library is not loaded with CaMykS initialisation. @@ -73,6 +73,7 @@ function get_XiaomiClientDevice($deviceCode='') { 'mi 9t' => array('platform_model' => 'Mi 9T', 'platform_year' => 2019), 'mi 9t pro' => array('platform_model' => 'Mi 9T Pro', 'platform_year' => 2019), 'mi note 10' => array('platform_model' => 'Mi Note 10', 'platform_year' => 2019), + 'mi note 10 pro' => array('platform_model' => 'Mi Note 10 Pro', 'platform_year' => 2019), 'mi note 10 lite' => array('platform_model' => 'Mi Note 10 Lite', 'platform_year' => 2020), 'mi 10' => array('platform_model' => 'Mi 10', 'platform_year' => 2020), diff --git a/plugin/input/BreadCrumbs/BreadCrumbs.php.inc b/plugin/input/BreadCrumbs/BreadCrumbs.php.inc index 918a1212..e70a186c 100755 --- a/plugin/input/BreadCrumbs/BreadCrumbs.php.inc +++ b/plugin/input/BreadCrumbs/BreadCrumbs.php.inc @@ -5,10 +5,10 @@ * @details Plugin / Input Engine * @file plugin/input/BreadCrumbs/BreadCrumbs.php.inc * @author CaMykS Team - * @version 1.0 + * @version 1.0.1 * @date Creation: Jul 2008 - * @date Modification: Apr 2018 - * @copyright 2008 - 2018 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2008 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -84,9 +84,9 @@ final class BreadCrumbs extends Input { while (isset($this->pages[$currentPage])) { $page = &$this->pages[$currentPage]; if ($page->active == 1) { - $p = array('title'=> $page->shorttitle!=''?$page->shorttitle:($page->title!=''?$page->title:$page->name), 'url'=>$page->get_siteLink()); + $p = array('title' => $page->get_shortTitleDisplay('html'), 'url'=>$page->get_siteLink()); } elseif ($page->id !=0 and ($page->shorttitle != '' or $page->title != '')) { - $p = array('title'=> $page->shorttitle!=''?$page->shorttitle:$page->title, 'url'=>false); + $p = array('title' => $page->get_shortTitleDisplay('html'), 'url'=>false); } else { break; } @@ -102,4 +102,4 @@ final class BreadCrumbs extends Input { parent::initialise(); } } -?> \ No newline at end of file +?> diff --git a/plugin/input/GenericMediaPopup/js/mediapopup.js b/plugin/input/GenericMediaPopup/js/mediapopup.js index 09f81e3b..f4a651c3 100755 --- a/plugin/input/GenericMediaPopup/js/mediapopup.js +++ b/plugin/input/GenericMediaPopup/js/mediapopup.js @@ -3,10 +3,10 @@ * @details Plugin / Input Javascripts * @file plugin/input/GenericMediaPopup/js/mediapopup.js * @author CaMykS Team - * @version 1.0.2 + * @version 1.0.3 * @date Creation: Oct 2011 - * @date Modification: Dec 2019 - * @copyright 2011 - 2019 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2011 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -163,7 +163,7 @@ function MediaPopup(name) { fileExt = file.split('.').pop().toLowerCase(); if (fileExt == 'flv' && swfobject) { // display FLV movie - /* update height with controller height */ + /* update height with controller height */ height += this.get_param('flvControlerHeight'); /* update container div size */ @@ -184,7 +184,7 @@ function MediaPopup(name) { /* display popup div */ this.show_popup('flash', width, height); - } else if (fileExt == 'swf' && swfobject) { + } else if (fileExt == 'swf' && swfobject) { /* update container div size */ contentBox.style.width = width+'px'; @@ -197,23 +197,23 @@ function MediaPopup(name) { swfobject.embedSWF(file, "MediaPopupContentBox", width, height, "9.0.0", false); - /* display popup div */ - this.show_popup('flash', width, height); + /* display popup div */ + this.show_popup('flash', width, height); - } else if (file.match(/https?:\/\/(www\.)?youtu\.be\//) != null) { // display youtube video - /* update container div size */ + } else if (file.match(/https?:\/\/(www\.)?youtu\.be\//) != null) { // display youtube video + /* update container div size */ contentBox.style.width = width+'px'; contentBox.style.height = height+'px'; /* add youtube iframe */ contentBox.innerHTML = ''; + + ' src="https://www.youtube.com/embed/'+file.substring(file.lastIndexOf('/'))+'"' + + ' frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>'; /* display popup div */ - this.show_popup('youtube', width, height); + this.show_popup('youtube', width, height); - } else if (file.indexOf('http://www.dailymotion.com/video/') == 0 || file.indexOf('http://dai.ly/') == 0) { // display dailymotion video + } else if (file.indexOf('http://www.dailymotion.com/video/') == 0 || file.indexOf('http://dai.ly/') == 0) { // display dailymotion video /* update container div size */ contentBox.style.width = width+'px'; contentBox.style.height = height+'px'; @@ -224,64 +224,62 @@ function MediaPopup(name) { /* add dailymotion iframe */ contentBox.innerHTML = ''; + + ' src="https://www.dailymotion.com/embed/video/'+video+'">'; /* display popup div */ this.show_popup('youtube', width, height); - } else if (fileExt == 'html' || fileExt == 'htm' - || file.indexOf('url:') == 0) { // display HTML file - - if (file.indexOf('url:') == 0) { - file = file.substring(4); - } + } else if (fileExt == 'html' || fileExt == 'htm' || file.indexOf('url:') == 0) { // display HTML file + if (file.indexOf('url:') == 0) { + file = file.substring(4); + } - /* update container div size */ + /* update container div size */ contentBox.style.width = width+'px'; contentBox.style.height = height+'px'; - /* add html frame to popup */ - if (this.get_param('navType') == 'real') { - html = document.createElement('object').cloneNode(true); - html.setAttribute('data', file); - html.setAttribute('type', 'text/html'); - html.style.width = width+'px'; - html.style.height = height+'px'; - } else { - html = document.createElement('iframe').cloneNode(true); - html.setAttribute('src', file); - html.setAttribute('frameBorder', 0); - html.setAttribute('width', width); - html.setAttribute('height', height); - } - contentBox.appendChild(html); + /* add html frame to popup */ + if (this.get_param('navType') == 'real') { + html = document.createElement('object').cloneNode(true); + html.setAttribute('data', file); + html.setAttribute('type', 'text/html'); + html.style.width = width+'px'; + html.style.height = height+'px'; + } else { + html = document.createElement('iframe').cloneNode(true); + html.setAttribute('src', file); + html.setAttribute('frameBorder', 0); + html.setAttribute('width', width); + html.setAttribute('height', height); + } + contentBox.appendChild(html); - /* display popup div */ - this.show_popup('html', width, height); - } else if (file.substring(0, 8) == 'content:') { // display HTML content + /* display popup div */ + this.show_popup('html', width, height); + } else if (file.substring(0, 8) == 'content:') { // display HTML content - /* update container div size */ + /* update container div size */ contentBox.style.width = width+'px'; contentBox.style.height = height+'px'; contentBox.style.maxWidth = '100%'; - contentBox.innerHTML = file.substring(8); + contentBox.innerHTML = file.substring(8); - /* display popup div */ - this.show_popup('html', width, height); - } else if (fileExt == 'mp4' || fileExt == 'm4v') { + /* display popup div */ + this.show_popup('html', width, height); + } else if (fileExt == 'mp4' || fileExt == 'm4v') { - /* update container div size */ + /* update container div size */ contentBox.style.width = width+'px'; contentBox.style.height = height+'px'; /* add video tag */ contentBox.innerHTML = ''; - /* display popup div */ - this.show_popup('video', width, height); - } else { // display Image + /* display popup div */ + this.show_popup('video', width, height); + } else { // display Image /* load image */ var mainImage = new Image(); diff --git a/plugin/input/LimonetikPayment/LimonetikPayment.php.inc b/plugin/input/LimonetikPayment/LimonetikPayment.php.inc new file mode 100755 index 00000000..d2b58628 --- /dev/null +++ b/plugin/input/LimonetikPayment/LimonetikPayment.php.inc @@ -0,0 +1,472 @@ + Interface to Limonetik payment system. + * @details Plugin / Input Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Oct 2020 + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * LimonetikPayment Input class. + */ +final class LimonetikPayment extends Input { + /** + * const array LIMONETIKAPIURLS + * @brief Stores Limonetik API URLs + */ + private const LIMONETIKAPIURLS = array( + 'test' => 'https://api.limonetikqualif.com', + 'live' => 'https://api.limonetik.com', + ); + + /** + * const string LIMONETIKAPIVERSION + * @brief Stores Limonerik API Version + */ + private const LIMONETIKAPIVERSION = 'V40'; + + /** + * var integer $_lastErrorCode + * @brief Last error code. + */ + protected $_lastErrorCode = 0; + + /** + * var string $_lastErrorMsg + * @brief Last error message. + */ + protected $_lastErrorMsg = ''; + + /** + * var string $_lastErrorDetails + * @brief Last error details. + */ + protected $_lastErrorDetails = ''; + + /** + * var string $_transactionId + * @brief Transaction id. + */ + private $_transactionId = ''; + + /** + * var array $params + * @brief Input parameters. + */ + public $params = array(); + + /** + * var array $confirmationData + * @brief Confirmation data received from Payzen instant notifications. + */ + private $confirmationData = null; + + /** + * var Object $config + * @brief Plugin configuration object. + */ + protected $config = null; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('LimonetikPayment', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'eCommerce'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* register plugin as Admin_Site extension */ + $this->register_asExtension('Admin_Site'); + } + + /* overwrite input methods */ + + /** + * Initialise input. + * @param array $params + * @return void + */ + public function initialise($params=array()) { + global $camyks; + + /* load plugin configuration */ + $this->load_configuration(); + + /* define params */ + $this->params = $params; + + /* Input generic initialization */ + parent::initialise(); + } + + /* execution methods */ + + /** + * Prepare for payment. + * @param array $params + * @return boolean result + */ + public function prepare_forPayment($params=array()) { + global $camyks; + + /* Load params */ + $defaultParams = array('amount' => 0, 'orderId' => '', 'paymentMode' => null); + $this->params = array_merge($defaultParams, $params); + + /* Build request data */ + $data = array( + "PaymentOrder" => array( + "MerchantId" => $this->config->vars['MerchantId'], + "PaymentPageId" => $this->config->get_paymentPageId($this->params['paymentMode']), + "Amount" => $this->params['amount'], + "Currency" => "EUR", + "MerchantUrls" => array( + "ReturnUrl" => $this->params['backURL_Confirm'], + "AbortedUrl" => $this->params['backURL_Cancel'], + "ErrorUrl" => $this->params['backURL_Refused'], + "ServerNotificationUrl" => $this->params['backURL_Response'], + ), + "MerchantOrder" => array( + "Id" => $this->params['orderId'], + "Customer" => array( + "Email" => $this->params['email'], + ), + ), + ), + ); + + /* Execute request to Limonetik server */ + if (($response = $this->execute_limonetikRequest('PaymentOrder/Create', $data)) === false) + return $this->display_error(); + + /* Backup Limonetik answer in session */ + $camyks->set_sessionValue('LimonetikAnswer', array( + 'RequestId' => $response['RequestId'], + 'PaymentOrderId' => $response['PaymentOrderId'], + )); + + /* Redirect user to Limonetik server */ + header('Location:'.$response['PaymentPageUrl']); + } + + /* data query methods */ + + /** + * Load confirmation data Payzen instant notification. + * @return void + */ + public function load_paymentConfirmation() { + + } + + /** + * Check if payment is confirmed. + * @return boolean result + */ + public function is_paymentConfirmed() { + return false; + } + + /** + * Check if payment is cancelled. + * @return boolean result + */ + public function is_paymentCancelled() { + return false; + } + + /** + * Return response data from confirmation request. + * @return array + */ + public function get_paymentConfirmationData() { + return array('uniqueId' => ''); + } + + /** + * Execute check out. + * @return array + */ + public function execute_checkout() { + global $camyks; + + $paymentData = $camyks->get_sessionValue('LimonetikAnswer'); + + /* Build request data */ + $data = array( + 'Id' => $paymentData['PaymentOrderId'], + ); + + /* Execute request to Limonetik server */ + if (($response = $this->execute_limonetikRequest('PaymentOrder/Detail', $data, 'GET')) === false) + return $camyks->log_internalerror($this, $this->_lastErrorMsg, $this->_lastErrorDetails, __FILE__, __LINE__); + + /* Check order status that shouldn't append */ + if (in_array($response['PaymentOrder']['Status'], array('Charged', 'Created', 'Payment_In_Progress'))) + return false; + + /* Check order has already be cancelled/refunded/error */ + if (in_array($response['PaymentOrder']['Status'], array('Cancelled', 'Refunded', 'Error'))) + return false; + + /* Cancel order on aborted / refused */ + if (in_array($response['PaymentOrder']['Status'], array('Aborted', 'Refused'))) { + $data = array( + 'PaymentOrderId' => $paymentData['PaymentOrderId'], + 'CancelAmount' => $this->params['amount'], + 'Currency' => 'EUR', + ); + if ($this->execute_limonetikRequest('PaymentOrder/Cancel', $data) === false) + return $camyks->log_internalerror($this, $this->_lastErrorMsg, $this->_lastErrorDetails, __FILE__, __LINE__); + return false; + } + + /* Charge order if payment status is authorised */ + if ($response['PaymentOrder']['Status'] === 'Authorized') { + $data = array( + 'PaymentOrderId' => $paymentData['PaymentOrderId'], + 'ChargeAmount' => $this->params['amount'], + 'Currency' => 'EUR', + ); + + if (($response2 = $this->execute_limonetikRequest('PaymentOrder/Charge', $data)) === false) + return $camyks->log_internalerror($this, $this->_lastErrorMsg, $this->_lastErrorDetails, __FILE__, __LINE__); + + $this->_transactionId = $response2['OperationId']; + return true; + } + + /* Order is authorising */ + if ($response['PaymentOrder']['Status'] === 'Authorizing') { + /* + $data = array( + 'PaymentOrderId' => $paymentData['PaymentOrderId'], + 'ChargeAmount' => $this->params['amount'], + 'Currency' => 'EUR', + ); + + if (($response2 = $this->execute_limonetikRequest('PaymentOrder/Charge', $data)) === false) + return $camyks->log_internalerror($this, $this->_lastErrorMsg, $this->_lastErrorDetails, __FILE__, __LINE__); + + $this->_transactionId = $response2['OperationId']; + */ + return false; + } + return false; + } + + /** + * Return transaction ID. + * @return string + */ + public function get_transactionId() { + + } + + /* Limonetik related methods */ + + /** + * Execute request to Limonetik server. + * @param string $action + * @param array $data + * @param string $method + * @return array + */ + private function execute_limonetikRequest($action, $data, $method='POST') { + + /* Load configuration */ + $this->load_configuration(); + + /* Define URL to use */ + $limonetikURL = self::LIMONETIKAPIURLS[$this->config->vars['runningMode']]; + $limonetikURL = $limonetikURL.'/Rest/'.self::LIMONETIKAPIVERSION.'/'.$action; + + /* Execute request to Limonetik server */ + $options = array( + 'http' => array( + 'method' => $method, + 'header' => "Content-type: application/json\r\n". + "Authorization: Basic ".$this->config->vars['APIKey']."\r\n.". + "Accept: application/json\r\n", + 'ignore_errors' => true, + 'timeout' => 10, + ), + ); + if ($method === 'GET') + $limonetikURL .= '?'.http_build_query($data); + else + $options['http']['content'] = json_encode($data); + + $context = stream_context_create($options); + $response = file_get_contents($limonetikURL, false, $context); + + /* Trim UTF-8 bom */ + $response = preg_replace("/^\xEF\xBB\xBF/", '', $response); + + /* Read Limonetik answer */ + if (!preg_match('#^HTTP/[0-9]\.[0-9] ([0-9]{3}) (.*)$#', $http_response_header[0], $matches) or $matches[1] != '200') { + $this->set_lastError(1, 'Invalid response from Limonetik server.', (isset($matches[0]) ? $matches[1].' '.$matches[2] : '')); + return false; + } + + /* Check response length */ + if (!(strlen($response) > 0)) { + $this->set_lastError(1, 'Invalid response from Limonetik server.'); + return false; + } + + /* Decode JSON response */ + $response = json_decode($response, true); + + /* Check decoding result */ + if (json_last_error() !== JSON_ERROR_NONE or !is_array($response)) { + $this->set_lastError(1, 'Invalid response from Limonetik server.', json_last_error_msg()); + return false; + } + + /* Check request answer */ + if ((int)$response['ReturnCode'] != 1000) { + $this->set_lastError(2, 'Error from Limonetik server.', $response['ReturnCode'].'('.$response['ReturnCode'].')'); + return false; + } + + /* Return response */ + return $response; + } + + /* Error handling methods */ + + /** + * Define last error. + * @param integer $errorCode + * @param string $errorMsg + * @param string $errorDetails + * @return return void + */ + private function set_lastError($errorCode, $errorMsg, $errorDetails='') { + $this->_lastErrorCode = $errorCode; + $this->_lastErrorMsg = $errorMsg; + $this->_lastErrorDetails = $errorDetails; + } + + /** + * Return last error as code. + * @return integer + */ + public function get_lastError() { + return $this->_lastErrorCode; + } + + /** + * Return last error as text. + * @return string + */ + public function get_lastErrorMessage() { + if ($this->_lastErrorMsg == '') + return ''; + return $this->_lastErrorMsg; + } + + /** + * Display error. + * @return void + */ + public function display_error() { + $this->set_selectedLayout('Error.html.inc'); + } + + /* Configuration related methods */ + + /** + * Return configuration value. + * @param string $item + * @param mixed $default + * @return void + */ + public function get_configValue($item, $default=null) { + $this->load_configuration(); + return $this->config->get_value($item, $default); + } + + /** + * Load plugin configuration. + * @return void + */ + private function load_configuration() { + /* Check configuration is already loaded */ + if (!is_null($this->config)) + return; + + /* load configuration library */ + $this->load_library('LimonetikPaymentConfig'); + + /* load config */ + $this->config = new LimonetikPaymentConfig('config', $this); + $this->config->get(); + } + + /* Admin_Site extension configuration methods */ + + /** + * Initialise object in Admin_Site / view configuration mode. + * @return void + */ + public function initialise_configDisplay() { + $this->load_configuration(); + } + + /** + * Display object in Admin_Site / view configuration mode. + * @return void + */ + public function display_configDisplay() { + $this->load_file('html/configuration/view.html.inc'); + } + + /** + * Initialise object in Admin_Site / edit configuration mode. + * @param Object $form + * @return void + */ + public function initialise_configEdition($form) { + $this->load_configuration(); + + /* update form */ + $this->form = &$form; + $this->form->set_object($this->config); + } + + /** + * Display object in Admin_Site / edit configuration mode. + * @return void + */ + public function display_configEdition() { + $this->load_file('html/configuration/edit.html.inc'); + } + + /** + * Execute object in Admin_Site / save configuration mode. + * @return void + */ + public function save_configuration() { + $this->load_configuration(); + $this->config->get_fromHeader(); + return $this->config->save(); + } +} +?> diff --git a/plugin/input/LimonetikPayment/html/Error.html.inc b/plugin/input/LimonetikPayment/html/Error.html.inc new file mode 100755 index 00000000..d9a118cc --- /dev/null +++ b/plugin/input/LimonetikPayment/html/Error.html.inc @@ -0,0 +1,32 @@ + + * @version 1.0.0 + * @date Creation: Oct 2020 + * @date Modification: Oct 2020 + * @copyright 2020 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +

+ get_translation('anerroroccured'); ?> +

+ +

+ _lastErrorMsg; ?> +

+ +

+ _lastErrorDetails; ?> +

+ +

+ theme->get_button(array( + 'title' => $this->get_translation('back'), + 'url' => $this->params['backURL_Cancel'], + )); ?> +

diff --git a/plugin/input/LimonetikPayment/html/configuration/edit.html.inc b/plugin/input/LimonetikPayment/html/configuration/edit.html.inc new file mode 100755 index 00000000..364cee01 --- /dev/null +++ b/plugin/input/LimonetikPayment/html/configuration/edit.html.inc @@ -0,0 +1,92 @@ + + * @version 1.0.0 + * @date Creation: Oct 2020 + * @date Modification: Oct 2020 + * @copyright 2020 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * @cond Exclude + */ +global $camyks; +?> +theme->get_boxContent2Header(); ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_operation'); ?> +
+ get_translation('formitem_mode'); ?> + + form->display_selectInput(array('name'=>'runningMode', 'class'=>'linputs', 'values'=>$this->config->get_modeList())); ?> +
+   +
+ get_translation('formtitle_authenticating'); ?> +
+ get_translation('formitem_apikey'); ?> + + form->display_textInput(array('name'=>'APIKey', 'class'=>'linputs', 'maxlength'=>255)); ?> +
+ get_translation('formitem_merchandid'); ?> + + form->display_textInput(array('name'=>'MerchantId', 'class'=>'linputs', 'maxlength'=>255)); ?> +
+ get_translation('formitem_payments'); ?> + + form->display_hiddenInput(array('name'=>'EnableCreditCard', 'default'=>"0")); ?> + form->display_checkBoxInput(array('name'=>'EnableCreditCard', 'value'=>1, 'label'=>$this->get_translation('payment_creditcard'), 'labelClass'=>'eContent2')); ?> +
+   + + form->display_hiddenInput(array('name'=>'EnableConecs', 'default'=>"0")); ?> + form->display_checkBoxInput(array('name'=>'EnableConecs', 'value'=>1, 'label'=>$this->get_translation('payment_conecs'), 'labelClass'=>'eContent2')); ?> +
+
+theme->get_boxContent2Footer(); ?> + diff --git a/plugin/input/LimonetikPayment/html/configuration/view.html.inc b/plugin/input/LimonetikPayment/html/configuration/view.html.inc new file mode 100755 index 00000000..b1d3c882 --- /dev/null +++ b/plugin/input/LimonetikPayment/html/configuration/view.html.inc @@ -0,0 +1,93 @@ + + * @version 1.0.0 + * @date Creation: Oct 2020 + * @date Modification: Oct 2020 + * @copyright 2020 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * @cond Exclude + */ +global $camyks; + +$form = new HTMLForm(); + +?> +theme->get_boxContent2Header(); ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_operation'); ?> +
+ get_translation('formitem_mode'); ?> + + config->get_modeTitle(); ?> +
+   +
+ get_translation('formtitle_authenticating'); ?> +
+ get_translation('formitem_apikey'); ?> + + config->vars['APIKey']; ?> +
+ get_translation('formitem_merchandid'); ?> + + config->vars['MerchantId']; ?> +
+ get_translation('formitem_payments'); ?> + + display_checkBoxInput(array('name'=>'EnableCreditCard', 'value'=>1, 'disabled'=>'disabled', 'default'=>$this->config->get_value('EnableCreditCard'), 'label'=>$this->get_translation('payment_creditcard'), 'labelClass'=>'eContent2')); ?> +
+   + + display_checkBoxInput(array('name'=>'EnableConecs', 'value'=>1, 'disabled'=>'disabled', 'default'=>$this->config->get_value('EnableConecs'), 'label'=>$this->get_translation('payment_conecs'), 'labelClass'=>'eContent2')); ?> +
+
+theme->get_boxContent2Footer(); ?> + diff --git a/plugin/input/LimonetikPayment/html/input.html.inc b/plugin/input/LimonetikPayment/html/input.html.inc new file mode 100755 index 00000000..b6d76949 --- /dev/null +++ b/plugin/input/LimonetikPayment/html/input.html.inc @@ -0,0 +1,17 @@ + + * @version 1.0.1 + * @date Creation: Oct 2020 + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +?> + +

+ get_translation('redirectobankmessage'); ?> +

diff --git a/plugin/input/LimonetikPayment/lib/LimonetikPaymentConfig.php.inc b/plugin/input/LimonetikPayment/lib/LimonetikPaymentConfig.php.inc new file mode 100755 index 00000000..79514492 --- /dev/null +++ b/plugin/input/LimonetikPayment/lib/LimonetikPaymentConfig.php.inc @@ -0,0 +1,74 @@ + + * @version 1.0.0 + * @date Creation: Oct 2020 + * @date Modification: Oct 2020 + * @copyright 2020 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * LimonetikPaymentConfig PluginConfig class. + */ +final class LimonetikPaymentConfig extends PluginConfig { + /** + * Class constructor. + * @param string $name + * @param Module $parent + * @return void + */ + public function __construct($name, &$parent) { + parent::__construct($name, $parent); + + /* Operation */ + $this->add_newItem('runningMode', 'string', 'test'); + + /* Limonetik configuration */ + $this->add_newItem('APIKey', 'string', ''); + $this->add_newItem('MerchantId', 'string', ''); + $this->add_newItem('EnableCreditCard', 'integer', 1); + $this->add_newItem('EnableConecs', 'integer', 0); + + /* Generic initialisation */ + parent::init_config(); + } + + /* Data related methods */ + + /** + * Return running mode value list. + * @return array + */ + public function get_modeList() { + return array( + 'test' => $this->get_translation('mode_test'), + 'live' => $this->get_translation('mode_live'), + ); + } + + /** + * Return mode value title. + * @return string + */ + public function get_modeTitle() { + $l = $this->get_modeList(); + return $l[$this->vars['runningMode']]; + } + + /** + * Return payment page id. + * @return string + */ + public function get_paymentPageId($payment=null) { + if ($payment == 'CreditCard' or (is_null($payment) and $this->get_value('EnableCreditCard') == true)) + return 'creditcard'; + if ($payment == 'Conecs' or (is_null($payment) and $this->get_value('EnableConecs') == true)) + return 'conecs'; + return ''; + } +} +?> diff --git a/plugin/input/LimonetikPayment/locale/translation_fr.php.inc b/plugin/input/LimonetikPayment/locale/translation_fr.php.inc new file mode 100755 index 00000000..6a745333 --- /dev/null +++ b/plugin/input/LimonetikPayment/locale/translation_fr.php.inc @@ -0,0 +1,36 @@ + + * @version 1.0.1 + * @date Creation: Oct 2020 + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* Mode value list */ +$this->trads['input_limonetikpayment_mode_test'] = 'Test'; +$this->trads['input_limonetikpayment_mode_live'] = 'Production'; + +/* configuration */ +$this->trads['input_limonetikpayment_formtitle_operation'] = 'Fonctionnement'; +$this->trads['input_limonetikpayment_formitem_mode'] = 'Mode : '; +$this->trads['input_limonetikpayment_formtitle_authenticating'] = 'Authentification'; +$this->trads['input_limonetikpayment_formitem_apikey'] = 'Clé API : '; +$this->trads['input_limonetikpayment_formitem_merchandid'] = 'ID marchand : '; +$this->trads['input_limonetikpayment_formitem_payments'] = 'Paiements disponibles : '; + +/* available payments */ +$this->trads['input_limonetikpayment_payment_creditcard'] = 'Carte de crédit'; +$this->trads['input_limonetikpayment_payment_conecs'] = 'Carte titre restaurant via Conecs'; + +/* site */ +$this->trads['input_limonetikpayment_anerroroccured'] = 'Une erreur est survenue.'; +$this->trads['input_limonetikpayment_back'] = 'Retour'; + +$this->trads['input_limonetikpayment_redirectobankmessage'] = 'Vous allez être redirigé vers le service bancaire.'; +$this->trads['input_limonetikpayment_redirectobankmessage2'] = 'Si ce n\'est pas le cas, cliquez ici.'; +?> diff --git a/plugin/input/SocialNetworksSharingPanel/SocialNetworksSharingPanel.php.inc b/plugin/input/SocialNetworksSharingPanel/SocialNetworksSharingPanel.php.inc index 1b108db1..0d755c73 100755 --- a/plugin/input/SocialNetworksSharingPanel/SocialNetworksSharingPanel.php.inc +++ b/plugin/input/SocialNetworksSharingPanel/SocialNetworksSharingPanel.php.inc @@ -4,10 +4,10 @@ *
Display social networks sharing and follow links. * @details Plugin / Input Engine * @author CaMykS Team - * @version 1.0.2 + * @version 1.0.3 * @date Creation: Nov 2009 - * @date Modification: Jun 2020 - * @copyright 2009 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2009 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -86,6 +86,7 @@ final class SocialNetworksSharingPanel extends Input { switch ($mode) { case 'share': return $this->initialise_sharePanel($params); case 'follow': return $this->initialise_followPanel($params); + case 'integrate': return $this->initialise_integratePanel($params); } } @@ -101,6 +102,7 @@ final class SocialNetworksSharingPanel extends Input { switch ($mode) { case 'share': $this->display_sharePanel($params); break; case 'follow' : $this->display_followPanel($params); break; + case 'integrate' : $this->display_integratePanel($params); break; } /* generic display */ @@ -179,7 +181,7 @@ final class SocialNetworksSharingPanel extends Input { 'iconsFolder' => '', ); - /* merge params */ + /* Merge params */ $this->iparams = array_merge($this->iparams, $params); /* clean title & description */ @@ -217,13 +219,13 @@ final class SocialNetworksSharingPanel extends Input { } /** - * Initialise input in follow mode + * Initialise input in follow mode. * @param array $params * @return void */ private function initialise_followPanel($params) { - /* merge params */ + /* Merge params */ $this->params = array_merge($this->config->vars, array('iconsFolder'=>''), $params); /* check for styles loading */ @@ -232,6 +234,37 @@ final class SocialNetworksSharingPanel extends Input { } } + /** + * Initialise input in follow mode + * @param array $params + * @return void + */ + private function initialise_integratePanel($params) { + global $camyks, $languages; + + /* Merge params */ + $this->params = array_merge($this->config->vars, array('network'=>''), $params); + + /* Load specific scripts */ + if ($this->params['network'] == 'facebook') { + $l = $languages[$camyks->current_language]['locale'][''][0]; + + /* + $this->add_JSExternFile('https://connect.facebook.net/'.$l.'/sdk.js'); + $this->add_JSExternFile('https://connect.facebook.net/'.$l.'/fbevents.js'); + */ + $this->add_JSScript(' + (function(d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); js.id = id; js.async = true; + js.src = "//connect.facebook.net/'.$l.'/sdk.js#xfbml=1&version=v2.5"; + fjs.parentNode.insertBefore(js, fjs); + }(document, \'script\', \'facebook-jssdk\')); + '); + } + } + /* specific display mode methods */ /** @@ -241,14 +274,14 @@ final class SocialNetworksSharingPanel extends Input { */ private function display_sharePanel($params=array()) { - /* update index */ + /* Update index */ $this->currentIndex++; - /* merge new params */ + /* Merge new params */ $this->dparams = array_merge($this->iparams, $params); $this->count_displayedNetworks(); - /* update selected layout */ + /* Update selected layout */ $this->set_selectedLayout('input.html.inc'); } @@ -258,13 +291,30 @@ final class SocialNetworksSharingPanel extends Input { * @return void */ private function display_followPanel($params=array()) { - /* merge params */ + /* Merge params */ $this->params = array_merge($this->params, $params); - /* update selected layout */ + /* Update selected layout */ $this->set_selectedLayout('input_follow.html.inc'); } + /** + * Display input in integrate mode. + * @param array $params + * @return void + */ + private function display_integratePanel($params=array()) { + /* Merge params */ + $this->params = array_merge($this->params, $params); + + /* Update selected layout */ + if ($this->params['network'] == '') + $this->set_selectedLayout('null'); + else + $this->set_selectedLayout('Integrate/'.$this->params['network'].'.html.inc'); + + } + /* specific tool methods */ /** @@ -585,6 +635,10 @@ final class SocialNetworksSharingPanel extends Input { 'name' => 'Follow', 'title' => $this->get_translation('tabfollow'), ), + array( + 'name' => 'Integrate', + 'title' => $this->get_translation('tabintegrate'), + ), )); /* initialise tabs */ @@ -607,7 +661,7 @@ final class SocialNetworksSharingPanel extends Input { public function initialise_configEdition($form) { global $camyks; - /* update form */ + /* Update form */ $this->form = &$form; $this->form->set_object($this->config); @@ -628,6 +682,10 @@ final class SocialNetworksSharingPanel extends Input { 'name' => 'Follow', 'title' => $this->get_translation('tabfollow'), ), + array( + 'name' => 'Integrate', + 'title' => $this->get_translation('tabintegrate'), + ), )); /* initialise tabs */ diff --git a/plugin/input/SocialNetworksSharingPanel/html/Integrate/facebook.html.inc b/plugin/input/SocialNetworksSharingPanel/html/Integrate/facebook.html.inc new file mode 100755 index 00000000..00988a56 --- /dev/null +++ b/plugin/input/SocialNetworksSharingPanel/html/Integrate/facebook.html.inc @@ -0,0 +1,35 @@ + + * @version 1.0.0 + * @date Creation: Jan 2021 + * @date Modification: Jan 2021 + * @copyright 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +$tabs = array(); +if ($this->params['integrate_facebook_tabTimeline']) + $tabs[] = 'timeline'; +if ($this->params['integrate_facebook_tabEvents']) + $tabs[] = 'events'; +if ($this->params['integrate_facebook_tabMessages']) + $tabs[] = 'messages'; +$tabs = implode(',', $tabs); +?> +
+ diff --git a/plugin/input/SocialNetworksSharingPanel/html/configuration/edit.html.inc b/plugin/input/SocialNetworksSharingPanel/html/configuration/edit.html.inc index 0a08a7b5..819f6f5d 100755 --- a/plugin/input/SocialNetworksSharingPanel/html/configuration/edit.html.inc +++ b/plugin/input/SocialNetworksSharingPanel/html/configuration/edit.html.inc @@ -2,12 +2,11 @@ /** * @brief SocialNetworksSharingPanel Input configuration edit layout * @details Plugin / Input layout - * @file plugin/input/SocialNetworksSharingPanel/html/configuration/edit.html.inc * @author CaMykS Team - * @version 1.0.1 + * @version 1.0.2 * @date Creation: Jan 2018 - * @date Modification: Jul 2018 - * @copyright 2018 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @cond Exclude @@ -16,193 +15,298 @@ global $camyks; ?> theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> theme->get_boxContent2Header(); ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - networks as $network => $data) : ?> - - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('formdesc_settings'); ?> -
- get_translation('formitem_pictureformat'); ?> - - form->display_selectInput(array('name'=>'share_pictureFormat', 'values'=>$this->config->get_pictureFormatList())); ?> -
-   -
- get_translation('formtitle_networks'); ?> -
- get_translation('formdesc_share'); ?> -
-   - -   -
- get_translation('formitem_separator'); ?> - - form->display_selectInput(array('name'=>'share_'.$network, 'values'=>$this->sharingValues)); ?> -
-   -
- get_translation('formtitle_like'); ?> -
- networks['facebook']['title'].$camyks->get_translation('formitem_separator'); ?> - - form->display_selectInput(array('name'=>'like_facebook', 'values'=>$this->likeValues, 'class'=>'sinputs')); ?> -  -  - get_translation('formitem_layout'); ?> form->display_selectInput(array('name'=>'like_facebookLayout', 'values'=>$this->config->get_facebookLayoutList(), 'class'=>'vsinputs')); ?> -  -  - get_translation('formitem_size'); ?> form->display_selectInput(array('name'=>'like_facebookSize', 'values'=>$this->config->get_facebookSizeList(), 'class'=>'vsinputs')); ?> -  -  - get_translation('formitem_action'); ?> form->display_selectInput(array('name'=>'like_facebookAction', 'values'=>$this->config->get_facebookActionList(), 'class'=>'vsinputs')); ?> -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + networks as $network => $data) : ?> + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formdesc_settings'); ?> +
+ get_translation('formitem_pictureformat'); ?> + + form->display_selectInput(array('name'=>'share_pictureFormat', 'values'=>$this->config->get_pictureFormatList())); ?> +
+   +
+ get_translation('formtitle_networks'); ?> +
+ get_translation('formdesc_share'); ?> +
+   + +   +
+ get_translation('formitem_separator'); ?> + + form->display_selectInput(array('name'=>'share_'.$network, 'values'=>$this->sharingValues)); ?> +
+   +
+ get_translation('formtitle_like'); ?> +
+ networks['facebook']['title'].$camyks->get_translation('formitem_separator'); ?> + + form->display_selectInput(array('name'=>'like_facebook', 'values'=>$this->likeValues, 'class'=>'sinputs')); ?> +  -  + get_translation('formitem_layout'); ?> form->display_selectInput(array('name'=>'like_facebookLayout', 'values'=>$this->config->get_facebookLayoutList(), 'class'=>'vsinputs')); ?> +  -  + get_translation('formitem_size'); ?> form->display_selectInput(array('name'=>'like_facebookSize', 'values'=>$this->config->get_facebookSizeList(), 'class'=>'vsinputs')); ?> +  -  + get_translation('formitem_action'); ?> form->display_selectInput(array('name'=>'like_facebookAction', 'values'=>$this->config->get_facebookActionList(), 'class'=>'vsinputs')); ?> +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - networks as $network => $data) : ?> - - - - - - - - - -
- get_translation('formdesc_settings'); ?> -
- get_translation('formitem_insertion'); ?> - - form->display_selectInput(array('name'=>'follow_insertion', 'values'=>$this->config->get_followInsertionList())); ?> -
- get_translation('formitem_stylesource'); ?> - - form->display_selectInput(array('name'=>'follow_styleSource', 'values'=>$this->config->get_followStyleSourceList())); ?> -
- get_translation('formitem_location'); ?> - - form->display_selectInput(array('name'=>'follow_location', 'values'=>$this->config->get_followLocationList())); ?> -
- get_translation('formitem_pictureformat'); ?> - - form->display_selectInput(array('name'=>'follow_pictureFormat', 'values'=>$this->config->get_pictureFormatList())); ?> -
-   -
- get_translation('formtitle_follownetworks'); ?> -
- get_translation('formdesc_follow'); ?> -
- get_translation('formitem_pictureformat'); ?> - - config->get_pictureFormatValue('follow'); ?> -
-   - -   -
- get_translation('formitem_separator'); ?> - - form->display_textInput(array('name'=>'follow_'.$network, 'maxlength'=>255, 'class'=>'linputs')); ?> -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + networks as $network => $data) : ?> + + + + + + + + +
+ get_translation('formdesc_settings'); ?> +
+ get_translation('formitem_insertion'); ?> + + form->display_selectInput(array('name'=>'follow_insertion', 'values'=>$this->config->get_followInsertionList())); ?> +
+ get_translation('formitem_stylesource'); ?> + + form->display_selectInput(array('name'=>'follow_styleSource', 'values'=>$this->config->get_followStyleSourceList())); ?> +
+ get_translation('formitem_location'); ?> + + form->display_selectInput(array('name'=>'follow_location', 'values'=>$this->config->get_followLocationList())); ?> +
+ get_translation('formitem_pictureformat'); ?> + + form->display_selectInput(array('name'=>'follow_pictureFormat', 'values'=>$this->config->get_pictureFormatList())); ?> +
+   +
+ get_translation('formtitle_follownetworks'); ?> +
+ get_translation('formdesc_follow'); ?> +
+ get_translation('formitem_pictureformat'); ?> + + config->get_pictureFormatValue('follow'); ?> +
+   + +   +
+ get_translation('formitem_separator'); ?> + + form->display_textInput(array('name'=>'follow_'.$network, 'maxlength'=>255, 'class'=>'linputs')); ?> +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_facebook'); ?> +
+ get_translation('formitem_facebookaccount'); ?> + + form->display_textInput(array('name'=>'integrate_facebook_href', 'maxlength'=>64)); ?> +
+ get_translation('formitem_width'); ?> + + form->display_numberInput(array('name'=>'integrate_facebook_width', 'maxlength'=>3, 'min'=>'180', 'max'=>'500', 'step'=>'10', 'class'=>'vsinputs')); ?> px + + get_translation('formitem_height'); ?> + + form->display_numberInput(array('name'=>'integrate_facebook_height', 'maxlength'=>3, 'min'=>'70', 'step'=>'10', 'class'=>'vsinputs')); ?> px +
+ get_translation('formitem_tabs'); ?> + + form->display_hiddenInput(array('name'=>'integrate_facebook_tabTimeline', 'default'=>'0')); ?> + form->display_checkboxInput(array('name'=>'integrate_facebook_tabTimeline', 'value'=>true, 'label'=>$this->get_translation('formvalue_timeline'), 'labelClass'=>'eContent2')); ?> + + get_translation('formitem_hidecover'); ?> + + form->display_booleanSelectInput(array('name'=>'integrate_facebook_hideCover', 'class'=>'sinputs')); ?> +
+   + + form->display_hiddenInput(array('name'=>'integrate_facebook_tabEvents', 'default'=>'0')); ?> + form->display_checkboxInput(array('name'=>'integrate_facebook_tabEvents', 'value'=>true, 'label'=>$this->get_translation('formvalue_events'), 'labelClass'=>'eContent2')); ?> + + get_translation('formitem_showfacepile'); ?> + + form->display_booleanSelectInput(array('name'=>'integrate_facebook_showFacePile', 'class'=>'sinputs')); ?> +
+   + + form->display_hiddenInput(array('name'=>'integrate_facebook_tabMessages', 'default'=>'0')); ?> + form->display_checkboxInput(array('name'=>'integrate_facebook_tabMessages', 'value'=>true, 'label'=>$this->get_translation('formvalue_messages'), 'labelClass'=>'eContent2')); ?> + + get_translation('formitem_hidecta'); ?> + + form->display_booleanSelectInput(array('name'=>'integrate_facebook_hideCTA', 'class'=>'sinputs')); ?> +
+ get_translation('formitem_smallheader'); ?> + + form->display_booleanSelectInput(array('name'=>'integrate_facebook_smallHeader', 'class'=>'sinputs')); ?> + + get_translation('formitem_adaptwidth'); ?> + + form->display_booleanSelectInput(array('name'=>'integrate_facebook_adaptWidth', 'class'=>'sinputs')); ?> +
+ get_translation('formitem_lazy'); ?> + + form->display_booleanSelectInput(array('name'=>'integrate_facebook_lazy', 'class'=>'sinputs')); ?> +
+ theme->get_boxContent2Footer(); ?> - * @version 1.0.1 + * @version 1.0.2 * @date Creation: Jan 2018 - * @date Modification: Jul 2018 - * @copyright 2018 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @cond Exclude @@ -16,187 +15,291 @@ global $camyks; ?> theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> theme->get_boxContent2Header(); ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - networks as $network => $data) : ?> - - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('formdesc_settings'); ?> -
- get_translation('formitem_pictureformat'); ?> - - config->get_pictureFormatValue('share'); ?> -
-   -
- get_translation('formtitle_networks'); ?> -
- get_translation('formdesc_share'); ?> -
-   - -   -
- get_translation('formitem_separator'); ?> - - config->get_sharingNetworkValue($network); ?> -
-   -
- get_translation('formtitle_like'); ?> -
- networks['facebook']['title'].$camyks->get_translation('formitem_separator'); ?> - - config->get_networkLikeValue('facebook'); ?> (config->vars['like_facebookLayout'].' / '.$this->config->vars['like_facebookSize'].' / '.$this->config->vars['like_facebookAction'];?>) -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + networks as $network => $data) : ?> + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formdesc_settings'); ?> +
+ get_translation('formitem_pictureformat'); ?> + + config->get_pictureFormatValue('share'); ?> +
+   +
+ get_translation('formtitle_networks'); ?> +
+ get_translation('formdesc_share'); ?> +
+   + +   +
+ get_translation('formitem_separator'); ?> + + config->get_sharingNetworkValue($network); ?> +
+   +
+ get_translation('formtitle_like'); ?> +
+ networks['facebook']['title'].$camyks->get_translation('formitem_separator'); ?> + + config->get_networkLikeValue('facebook'); ?> (config->vars['like_facebookLayout'].' / '.$this->config->vars['like_facebookSize'].' / '.$this->config->vars['like_facebookAction'];?>) +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - networks as $network => $data) : ?> - - - - - - - - - -
- get_translation('formdesc_settings'); ?> -
- get_translation('formitem_insertion'); ?> - - config->get_followInsertionTitle(); ?> -
- get_translation('formitem_stylesource'); ?> - - config->get_followStyleSourceTitle(); ?> -
- get_translation('formitem_location'); ?> - - config->get_followLocationTitle(); ?> -
- get_translation('formitem_pictureformat'); ?> - - config->get_pictureFormatValue('follow'); ?> -
-   -
- get_translation('formtitle_follownetworks'); ?> -
- get_translation('formdesc_follow'); ?> -
-   - -   -
- get_translation('formitem_separator'); ?> - - config->vars['follow_'.$network] == '') : ?> - - get_translation('nosocialnetwork'); ?> - - - - config->vars['follow_'.$network]; ?> - - -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + networks as $network => $data) : ?> + + + + + + + + +
+ get_translation('formdesc_settings'); ?> +
+ get_translation('formitem_insertion'); ?> + + config->get_followInsertionTitle(); ?> +
+ get_translation('formitem_stylesource'); ?> + + config->get_followStyleSourceTitle(); ?> +
+ get_translation('formitem_location'); ?> + + config->get_followLocationTitle(); ?> +
+ get_translation('formitem_pictureformat'); ?> + + config->get_pictureFormatValue('follow'); ?> +
+   +
+ get_translation('formtitle_follownetworks'); ?> +
+ get_translation('formdesc_follow'); ?> +
+   + +   +
+ get_translation('formitem_separator'); ?> + + config->vars['follow_'.$network] == '') : ?> + + get_translation('nosocialnetwork'); ?> + + + + config->vars['follow_'.$network]; ?> + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_facebook'); ?> +
+ get_translation('formitem_facebookaccount'); ?> + + config->get_value('integrate_facebook_href'); ?> +
+ get_translation('formitem_width'); ?> + + config->get_value('integrate_facebook_width'); ?> px + + get_translation('formitem_height'); ?> + + config->get_value('integrate_facebook_height'); ?> px +
+ get_translation('formitem_tabs'); ?> + + theme->get_pictHTMLTag(array('pict'=>($this->config->get_value('integrate_facebook_tabTimeline') ? 'valid' : 'empty'))); ?> + get_translation('formvalue_timeline'); ?> + + get_translation('formitem_hidecover'); ?> + + get_translation($this->config->get_value('integrate_facebook_hideCover') ? 'yes' : 'no'); ?> +
+   + + theme->get_pictHTMLTag(array('pict'=>($this->config->get_value('integrate_facebook_tabEvents') ? 'valid' : 'empty'))); ?> + get_translation('formvalue_events'); ?> + + get_translation('formitem_showfacepile'); ?> + + get_translation($this->config->get_value('integrate_facebook_showFacePile') ? 'yes' : 'no'); ?> +
+   + + theme->get_pictHTMLTag(array('pict'=>($this->config->get_value('integrate_facebook_tabMessages') ? 'valid' : 'empty'))); ?> + get_translation('formvalue_messages'); ?> + + get_translation('formitem_hidecta'); ?> + + get_translation($this->config->get_value('integrate_facebook_hideCTA') ? 'yes' : 'no'); ?> +
+ get_translation('formitem_smallheader'); ?> + + get_translation($this->config->get_value('integrate_facebook_smallHeader') ? 'yes' : 'no'); ?> + + get_translation('formitem_adaptwidth'); ?> + + get_translation($this->config->get_value('integrate_facebook_adaptWidth') ? 'yes' : 'no'); ?> +
+ get_translation('formitem_lazy'); ?> + + get_translation($this->config->get_value('integrate_facebook_lazy') ? 'yes' : 'no'); ?> +
+ theme->get_boxContent2Footer(); ?> - * @version 1.0.1 + * @version 1.0.2 * @date Creation: Jan 2018 - * @date Modification: Jul 2018 - * @copyright 2018 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -47,9 +46,22 @@ final class SocialNetworksSharingPanelConfig extends PluginConfig { $this->add_newItem('follow_insertion', 'int', 0); // 0 : manual / 1 : automatic $this->add_newItem('follow_styleSource', 'string', 'plugin'); // plugin / theme $this->add_newItem('follow_location', 'string', 'fixed-left'); // left / right - $this->add_newItem('follow_pictureFormat', 'string', 'png'); + /* facebook integration params */ + $this->add_newItem('integrate_facebook_href', 'string', ''); + $this->add_newItem('integrate_facebook_width', 'integer', 340); + $this->add_newItem('integrate_facebook_height', 'integer', 500); + $this->add_newItem('integrate_facebook_tabTimeline', 'boolean', true); + $this->add_newItem('integrate_facebook_tabEvents', 'boolean', false); + $this->add_newItem('integrate_facebook_tabMessages', 'boolean', false); + $this->add_newItem('integrate_facebook_hideCover', 'boolean', false); + $this->add_newItem('integrate_facebook_showFacePile', 'boolean', true); + $this->add_newItem('integrate_facebook_hideCTA', 'boolean', false); + $this->add_newItem('integrate_facebook_smallHeader', 'boolean', false); + $this->add_newItem('integrate_facebook_adaptWidth', 'boolean', true); + $this->add_newItem('integrate_facebook_lazy', 'boolean', false); + /* set up variables */ $this->sharingValues = false; $this->likeValues = false; diff --git a/plugin/input/SocialNetworksSharingPanel/locale/translation_fr.php.inc b/plugin/input/SocialNetworksSharingPanel/locale/translation_fr.php.inc index a46669a5..807b8ff6 100755 --- a/plugin/input/SocialNetworksSharingPanel/locale/translation_fr.php.inc +++ b/plugin/input/SocialNetworksSharingPanel/locale/translation_fr.php.inc @@ -2,12 +2,11 @@ /** * @brief SocialNetworksSharingPanel Input french dictionnary * @details Plugin / Input Dictionnary - * @file plugin/input/SocialNetworksSharingPanel/locale/translation_fr.php.inc * @author CaMykS Team - * @version 1.0 + * @version 1.0.2 * @date Creation: Feb 2012 - * @date Modification: Jul 2018 - * @copyright 2012 - 2018 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2012 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -55,4 +54,21 @@ $this->trads['input_socialnetworkssharingpanel_followlocation_fixedleft'] = 'Fix $this->trads['input_socialnetworkssharingpanel_followlocation_fixedright'] = 'Fixé à droite'; $this->trads['input_socialnetworkssharingpanel_formtitle_follownetworks'] = 'Vos pages à suivre'; + +$this->trads['input_socialnetworkssharingpanel_tabintegrate'] = 'Intégrer'; +$this->trads['input_socialnetworkssharingpanel_formtitle_facebook'] = 'Facebook'; + +$this->trads['input_socialnetworkssharingpanel_formitem_facebookaccount'] = 'Compte : '; +$this->trads['input_socialnetworkssharingpanel_formitem_width'] = 'Largeur : '; +$this->trads['input_socialnetworkssharingpanel_formitem_height'] = 'Hauteur : '; +$this->trads['input_socialnetworkssharingpanel_formitem_tabs'] = 'Onglets : '; +$this->trads['input_socialnetworkssharingpanel_formvalue_timeline'] = 'Timeline'; +$this->trads['input_socialnetworkssharingpanel_formvalue_events'] = 'Events'; +$this->trads['input_socialnetworkssharingpanel_formvalue_messages'] = 'Messages'; +$this->trads['input_socialnetworkssharingpanel_formitem_hidecover'] = 'Cacher la photo : '; +$this->trads['input_socialnetworkssharingpanel_formitem_showfacepile'] = 'Afficher les photos des likers : '; +$this->trads['input_socialnetworkssharingpanel_formitem_hidecta'] = 'Cacher le bouton d\'appel à action : '; +$this->trads['input_socialnetworkssharingpanel_formitem_smallheader'] = 'En-tête réduite : '; +$this->trads['input_socialnetworkssharingpanel_formitem_adaptwidth'] = 'Adaptation automatique de la largeur : '; +$this->trads['input_socialnetworkssharingpanel_formitem_lazy'] = 'Mode "lazy" activé : '; ?> diff --git a/plugin/input/StripePayment/css/global.css b/plugin/input/StripePayment/css/global.css index 51b5ab14..da066b0a 100644 --- a/plugin/input/StripePayment/css/global.css +++ b/plugin/input/StripePayment/css/global.css @@ -192,6 +192,22 @@ pre { } } +@media (max-width: 640px) { + .sr-root { + padding: 24px 0; + } + + .sr-main { + padding: 25px 8px; + border-radius: none; + box-shadow: none; + } + + .CardField-number:after { + content:'
'; + } +} + /* todo: spinner/processing state, errors, animations */ .spinner, diff --git a/plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc b/plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc index 8487ca9b..80233a09 100755 --- a/plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc +++ b/plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc @@ -5,10 +5,10 @@ * @details Plugin, Module Engine * @file plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc * @author CaMykS Team - * @version 1.1.3 + * @version 1.1.3.1 * @date Creation: Jun 2005 - * @date Modification: May 2020 - * @copyright 2005 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2005 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @todo other page type (folder, ...) @@ -999,7 +999,6 @@ final class Admin_ContentPage extends Module { * @return string */ public function get_sitePageLink($page='', $lg='', $params=array()) { - /* no page, no link */ if ($page == '') return ''; @@ -1025,7 +1024,6 @@ final class Admin_ContentPage extends Module { * @return string */ public function get_siteKeyPageLink($key='', $lg='', $params=array()) { - /* no page, no link */ if ($key == '') return ''; diff --git a/plugin/module/Admin_ContentPage/lib/ContentPage.php.inc b/plugin/module/Admin_ContentPage/lib/ContentPage.php.inc index ad007735..0ec15c8f 100644 --- a/plugin/module/Admin_ContentPage/lib/ContentPage.php.inc +++ b/plugin/module/Admin_ContentPage/lib/ContentPage.php.inc @@ -2,12 +2,11 @@ /** * @brief Admin_ContentPage Module ContentPage library * @details Plugin / Module Library - * @file plugin/module/Admin_ContentPage/lib/ContentPage.php.inc * @author CaMykS Team - * @version 1.1.5.1 + * @version 1.1.5.2 * @date Creation: Jun 2005 - * @date Modification: Jun 2020 - * @copyright 2005 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2005 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -379,16 +378,16 @@ final class ContentPage { /* check empty name */ if ($this->name == '') { if ($this->id > 0) { - $this->name = $this->type.$this->id; + $this->name = $this->type.$this->id; } else { - $sql = 'select max(id) as m from admin_contentpage'; - if ($camyks->db_conn->execute_query($sql) or $camyks->log_sqlerror($this, $sql, __FILE__, __LINE__)) - if ($data = $camyks->db_conn->get_queryDataLine()) - $this->name = $this->type.($data['m']+1); + $sql = 'select max(id) as m from admin_contentpage'; + if ($camyks->db_conn->execute_query($sql) or $camyks->log_sqlerror($this, $sql, __FILE__, __LINE__)) + if ($data = $camyks->db_conn->get_queryDataLine()) + $this->name = $this->type.($data['m']+1); + else + $this->name = $this->type; else $this->name = $this->type; - else - $this->name = $this->type; } } else if (!preg_match ('([_a-zA-Z\-])', $this->name)) { /* check if name contain at least one alphabetic char */ @@ -476,7 +475,7 @@ final class ContentPage { * @return boolean success */ private function get_fromDatabase($page=null) { - if (isset ($page)) { + if (isset($page)) { if (is_numeric($page)) return $this->get_objectFromDatabase(' and admin_contentpage.id='.(int)$page); else if (is_string($page)) @@ -506,7 +505,7 @@ final class ContentPage { * @param string $query some query modification * @return boolean success */ - private function get_objectFromDatabase ($query='') { + private function get_objectFromDatabase($query='') { global $camyks; $sql = 'select *'; $sql .= ' from admin_contentpage, admin_contentpagelocale'; @@ -535,7 +534,6 @@ final class ContentPage { return false; } - /** * Load all object version from database, set the latest version to the object. * @return boolean success @@ -1332,7 +1330,6 @@ final class ContentPage { public function get_siteLink($params=array(), $lg='') { global $camyks; - /* add name */ $link = $this->name; @@ -1394,7 +1391,7 @@ final class ContentPage { $this->modules[$index]->display_admin(); break; case CAMYKS_MODE_SITE : - if ($camyks->benchMode!==false) $camyks->benchMode->start('Display module '.$index); + if ($camyks->benchMode !== false) $camyks->benchMode->start('Display module '.$index); $this->modules[$index]->display_site($index); break; } diff --git a/plugin/module/Admin_ContentPage/locale/translation_en.php.inc b/plugin/module/Admin_ContentPage/locale/translation_en.php.inc index 029ee951..a58db318 100755 --- a/plugin/module/Admin_ContentPage/locale/translation_en.php.inc +++ b/plugin/module/Admin_ContentPage/locale/translation_en.php.inc @@ -2,12 +2,11 @@ /** * @brief Admin_ContentPage Module english dictionnary * @details Plugin / Module Dictionnary - * @file plugin/module/Admin_ContentPage/locale/translation_en.php.inc * @author CaMykS Team - * @version 1.0.2 + * @version 1.0.2.1 * @date Creation: Sep 2009 - * @date Modification: Feb 2019 - * @copyright 2009 - 2019 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2009 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -16,6 +15,7 @@ $this->trads['mod_admin_contentpage_desc'] = 'Manager website pages'; /* global */ $this->trads['mod_admin_contentpage_pagetitle'] = 'Page'; +$this->trads['mod_admin_contentpage_page'] = 'Page'; $this->trads['mod_admin_contentpage_pages'] = 'Pages'; /* rights */ diff --git a/plugin/module/Admin_GenericContactFormManager/Admin_GenericContactFormManager.php.inc b/plugin/module/Admin_GenericContactFormManager/Admin_GenericContactFormManager.php.inc index 80f516a2..6a7e2098 100755 --- a/plugin/module/Admin_GenericContactFormManager/Admin_GenericContactFormManager.php.inc +++ b/plugin/module/Admin_GenericContactFormManager/Admin_GenericContactFormManager.php.inc @@ -1,614 +1,633 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Nov 2010 - * Last Modif Date : Nov 2010 - * History : - * * 10-11-02 : Initial files - * - * Admin_GenericContactFormManager module - */ - -class Admin_GenericContactFormManager extends Module { - /* - * internal variable - */ - var $formItem; - var $formList; - var $subjectItem; - var $subjectList; - - /* - * constructor - * @param string $path_type - */ - function Admin_GenericContactFormManager ( $path_type ) { - parent::Module('Admin_GenericContactFormManager', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'content'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Generic'; - /* set plugin author */ - $this->author_name = 'CaMykS'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* load plugin libaries */ - $this->libs[] = 'Admin_GenericContactFormManagerForm.php.inc'; - $this->libs[] = 'Admin_GenericContactFormManagerSubject.php.inc'; - $this->libs[] = 'Admin_GenericContactFormManagerConfig.php.inc'; - $this->get_PHPLibs(); - - /* initialise plugin libraries */ - $this->formItem = new Admin_GenericContactFormManagerForm(0, $this); - $this->subjectItem = new Admin_GenericContactFormManagerSubject(0, $this); - $this->config = new Admin_GenericContactFormManagerConfig('config', $this); - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - return ($this->formItem->install() and $this->subjectItem->install() - and $this->config->install() and parent::install()); - } - - /* - * unintall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - return parent::uninstall(); - } - - /* - * check module installation - * @return boolean result - * @access private - */ - function is_installed () { - return $this->formItem->is_installed(); - } - - /* - * get module rights - * @return void - * @access private - */ - function get_rights() { - global $camyks; - $this->rights[0] = array('name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=>true); - $this->rights[1] = array('name'=>'edit_forms', - 'title'=> $this->get_translation('rights_editforms'), - 'default'=>false); - $this->rights[2] = array('name'=>'edit_subject', - 'title'=>$this->get_translation('rights_editsubjects'), - 'default'=>false); - $this->rights[3] = array('name'=>'edit_config', - 'title'=>$this->get_translation('rights_editconfig'), - 'default'=>false); - } - - /* - * update control panel description - * @return void - * @access private - */ - function get_adminControlPanelAction( ) { - global $camyks; - $n = $this->formItem->get_objectCount('status=0'); - if ( $n == 1 ) - $camyks->trads['mod_admin_genericcontactformmanager_desc'] = $camyks->trads['mod_admin_genericcontactformmanager_desc1']; - elseif ($n > 1) - $camyks->trads['mod_admin_genericcontactformmanager_desc'] = vsprintf($camyks->trads['mod_admin_genericcontactformmanager_descx'], $n); - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - /* check read rights */ - if ( $this->check_right(0) === false ) - return $this->init_admin_accessDenied(); - - /* check dependencies */ - if (!isset($camyks->inputs['AdminItemListViewer'])) - return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); - if(!isset($camyks->inputs['TabBuilder'])) - return $this->init_admin_missingPlugin('Input', 'TabBuilder'); - - /* get informations */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'main' ); - - /* load config */ - $this->config->get(); - - /* check action to execute */ - switch ( $this->mode ) { - case 'view_form': - /* mode == view_form */ - $this->init_admin_viewForm(); - break; - case 'edit_form': - /* mode == edit_form */ - $this->init_admin_editForm(); - break; - case 'save_form': - /* mode == save_form */ - $this->init_admin_saveForm(); - break; - case 'delete_form': - /* mode == delete_form */ - $this->init_admin_deleteForm(); - break; - case 'view_subject': - /* mode == view_subject */ - $this->init_admin_viewSubject(); - break; - case 'edit_subject': - /* mode == edit_subject */ - $this->init_admin_editSubject(); - break; - case 'save_subject': - /* mode == save_subject */ - $this->init_admin_saveSubject(); - break; - case 'delete_subject': - /* mode == delete_subject */ - $this->init_admin_deleteSubject(); - break; - case 'edit_config': - /* mode == edit_config */ - $this->init_admin_editConfig(); - break; - case 'save_config': - /* mode == save_config */ - $this->init_admin_saveConfig(); - break; - case 'main': - default: - /* mode == main */ - $this->init_admin_main(); - } - - /* generic Module init */ - parent::init_admin(); - } - - /* - * display module object in admin mode - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* specific admin mode methods */ - - /* - * init module object in admin/main mode - * @return void - * @access private - */ - function init_admin_main() { - global $camyks; - - /* get data */ - $this->adminTitle = $this->title; - - /* load list parameters*/ - $this->load_file('lib/Admin_GenericContactFormManagerFormListParams.php.inc'); - - /* initialise object list input */ - $this->formList = &$camyks->inputs['AdminItemListViewer']; - /* add parameters */ - $this->formList->set_params($this->formListParams); - /* initialise input */ - $this->formList->initialise(); - - /* check for config panel */ - if ($this->check_right(2) !== false) { - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - $this->tabBuilder->add_tabs(array(array('name'=>'config', - 'title'=>$this->get_translation('tabconfig')), - array('name'=>'forms', - 'title'=>$this->get_translation('tabforms')))); - $this->tabBuilder->initialise(array('default'=>'forms')); - } - - /* get buttons */ - $this->buttons = array(array('link'=>$camyks->get_adminLink(), - 'title'=>$camyks->get_translation('back'))); - } - - /* - * init module object in admin/view_form mode - * @return void - * @access private - */ - function init_admin_viewForm(){ - global $camyks; - - /* check item id */ - if (!isset($_REQUEST['form_id'])) - return $this->init_admin_main(); - - /* load form */ - $this->formItem->id = $_REQUEST['form_id']; - $this->formItem->get(); - $this->formItem->get_fromItems(); - - /* load interface title */ - $this->adminTitle = $this->get_translation('title_formid', $this->formItem->id); - - /* build buttons list */ - $this->buttons = array(array('link'=>$this->get_adminLink(), - 'title'=>$camyks->get_translation('back'))); - - /* update layout */ - $this->selected_layout = 'admin_view_form.html.inc'; - } - - /* - * init module object in admin/edit_form mode - * @return void - * @access private - */ - function init_admin_editForm(){ - global $camyks; - - /* check rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* get item */ - $this->formItem->id = isset($_REQUEST['form_id'])?$_REQUEST['form_id']:0; - $this->formItem->get(); - $this->formItem->get_fromItems(); - - /* build edition form */ - $this->editform = new HTMLForm('editform', - $this->get_adminLink(array('mode'=>'save_form')), - 'POST'); - $this->editform->set_object($this->formItem); - $this->editform->add_hidden('form_id', $this->formItem->id); - $this->editform->add_hidden('locale', $this->formItem->vars['locale']); - $this->editform->add_hidden('ipaddress', $this->formItem->vars['ipaddress']); - - /* load interface title */ - if ($this->formItem->id == 0 ) - $this->adminTitle = $this->get_translation('title_newform'); - else - $this->adminTitle = $this->get_translation('title_formid', $this->formItem->id); - - - /* build buttons list */ - $this->buttons = array(array('link'=>$this->get_adminLink(), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->editform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - - /* update layout */ - $this->selected_layout = 'admin_edit_form.html.inc'; - } - - /* - * init module object in admin/save_form mode - * @return void - * @access private - */ - function init_admin_saveForm(){ - global $camyks; - - /* check rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* check item id */ - if (!isset($_REQUEST['form_id'])) - return $this->init_admin_main(); - - /* try to save item */ - $this->formItem->id = $_REQUEST['form_id']; - $this->formItem->get_fromHeader(); - if ( $this->formItem->save() ) { - $this->text = $this->get_translation('form_saved'); - } else { - $this->text = $this->get_translation('form_notsaved'); - } - /* update layout */ - $this->selected_layout = 'admin_form.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink()); - } - - /* - * init module object in admin/delete_form mode - * @return void - * @access private - */ - function init_admin_deleteForm(){ - global $camyks; - - /* check rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* check item id */ - if (!isset($_REQUEST['form_id'])) - return $this->init_admin_main(); - - /* try to save item */ - $this->formItem->id = $_REQUEST['form_id']; - if ( $this->formItem->delete()){ - $this->text = $this->get_translation('form_deleted'); - } else { - $this->text = $this->get_translation('form_notdeleted'); - } - /* update layout */ - $this->selected_layout = 'admin_form.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink()); - } - - /* - * init module object in admin/edit_config mode - * @return void - * @access private - */ - function init_admin_editConfig() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* load config */ - $this->config->get(); - - /* load external data */ - $this->userList = $camyks->modules['Admin_User']->get_activeUserList(true); - - /* get configuration form */ - $this->configform = new HTMLForm('configform', - $this->get_adminLink(array('mode' => 'save_config')), - 'POST'); - $this->configform->set_object($this->config); - $this->configform->add_hidden('notification_recipients_count_', count($this->userList)); - - /* build window title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - $this->adminTitle .= $this->get_translation('title_config'); - - /* build button list */ - $this->buttons = array(array('link'=>$camyks->get_adminLink(), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->configform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - - /* update layout */ - $this->selected_layout = 'admin_edit_config.html.inc'; - } - - /* - * init module object in admin/save_config mode - * @return void - * @access private - */ - function init_admin_saveConfig() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save config */ - $this->config->get_fromHeader(); - if ( $this->config->save()) - $this->text = $this->get_translation('config_saved'); - else - $this->text = $this->get_translation('config_notsaved'); - - /* update layout */ - $this->selected_layout = 'admin_form.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink()); - } - - /* specific tool methods */ - - /* - * return forms status list - * @param boolean $full - * @return array - * @access private - */ - function get_formsStatusList($full=false) { - return $this->formItem->get_multiStatusList($full); - } - - /* - * return form status list - * @return array - * @access private - */ - function get_formStatusList() { - return $this->formItem->get_statusList(); - } - - /* - * return form status icon list - * @return array - * @access private - */ - function get_formStatusIconList() { - return $this->formItem->get_statusIconList(); - } - - /* - * send notification emails - * @param string $vEmail - * @return void - * @access private - */ - function send_notifications() { - global $camyks; - - /* check for notifications status */ - if($this->get_configValue('notification_status') == 0) - return true; - - /* load sender & recipients */ - $sender = $this->get_configValue('notification_sender'); - $recipients = $this->get_configValue('notification_recipients'); - - /* check sender & recipients */ - if ($sender == '' or count($recipients) == 0) - return true; - - /* load content */ - $subject = string_html2Text($this->get_translation('notification_emailsubject')); - - /* send email */ - foreach ($recipients as $rec) { - $this->admin = new AdminUser($rec); - $this->admin->get(); - $content = $this->get_notificationContent(); - mail_sendHTMLMail(array('to'=>$this->admin->email, - 'from'=>$sender, - 'subject'=>$subject, - 'content'=>$content)); - } - } - - /* - * return admin email content - * @return string - * @access private - */ - function get_notificationContent() { - global $camyks; - /* load CSS */ - $css = $camyks->themes[$camyks->get_confValue('site_default_theme')]->get_filePath('email.css'); - - /* build html page */ - ob_start(); - $page = new HTMLPage(); - $page->add_styleIncludedFile($css); - $page->add_HTMLHeader(); - $this->load_file('html/email_notification.html.inc'); - $page->add_HTMLFooter(); - - $c = ob_get_contents(); - ob_end_clean(); - return $c; - } - - /* - * update statistics - * @return boolean success - * @access private - */ - function update_statistics() { - global $camyks; - - /* check for statistics status */ - if($this->get_configValue('statistic_status') == 0) - return true; - - /* update statistics */ - return $camyks->update_statistic('contact_form', $this->name, 'dated', '', '', ''); - } - - /* - * get config value - * @param string $item - * @return mixed - * @access private - */ - function get_configValue($item) { - if (!isset($this->config->vars)) - $this->config->get(); - return $this->config->vars[$item]; - } - - /* specific public methods */ - - /* - * return form list - * @param array $params - * @return array - * @access public - */ - function get_formList($params) { - return $this->formItem->get_list($params); - } - - /* - * save form from site - * @return boolean success - * @access public - */ - function save_siteForm() { - $this->formItem->id = 0; - $this->formItem->get_fromHeader(); - if($this->formItem->save()) { - $this->send_notifications(); - $this->update_statistics(); - return true; - } - $this->formItem->get_fromItems(); - return false; - } - - /* - * return form object - * @return object - * @access public - */ - function get_formObject() { - return $this->formItem; - } - - /* - * return form count - * @param array $param - * @return integer - * @access public - */ - function count_forms($params=array()) { - return $this->formItem->count($params); - } - -} -?> \ No newline at end of file + Manages sent contact form requests. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericContactFormManager class. + */ +final class Admin_GenericContactFormManager extends Module { + /** + * var Object $formItem + * @brief Form request object. + */ + public $formItem; + + /** + * var array $formList + * @brief Form request list. + */ + public $formList = null; + + /** + * var Object $subjectItem + * @brief Form subject object. + */ + public $subjectItem; + + /** + * var array $subjectList + * @brief Form subject list. + */ + public $subjectList = null; + + /** + * var Object $config + * @brief Plugin configuration. + */ + protected $config; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_GenericContactFormManager', $path_type); + + /* Override Plugin variables */ + $this->plugin_package = 'Generic'; + $this->version = '1.0'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'content'; + + /* Define plugin author */ + $this->author_name = 'CaMykS'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load plugin libaries */ + $this->load_library('Admin_GenericContactFormManagerForm'); + $this->load_library('Admin_GenericContactFormManagerSubject'); + $this->load_library('Admin_GenericContactFormManagerConfig'); + + /* Initialise plugin libraries */ + $this->formItem = new Admin_GenericContactFormManagerForm(0, $this); + $this->subjectItem = new Admin_GenericContactFormManagerSubject(0, $this); + $this->config = new Admin_GenericContactFormManagerConfig('config', $this); + } + + /* Override Module methods */ + + /** + * Install module. + * @return boolean success + */ + public function install() { + return ($this->formItem->install() and $this->subjectItem->install() + and $this->config->install() and parent::install()); + } + + /** + * Unintall module. + * @return boolean success + */ + public function uninstall() { + return parent::uninstall(); + } + + /** + * Check module installation. + * @return boolean result + */ + public function is_installed() { + return $this->formItem->is_installed(); + } + + /** + * Define module permission. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => true, + ); + $this->rights[1] = array( + 'name' => 'edit_forms', + 'title' => $this->get_translation('rights_editforms'), + 'default' => false, + ); + $this->rights[2] = array( + 'name' => 'edit_subject', + 'title' => $this->get_translation('rights_editsubjects'), + 'default' => false, + ); + $this->rights[3] = array( + 'name' => 'edit_config', + 'title' => $this->get_translation('rights_editconfig'), + 'default' => false, + ); + } + + /** + * Update control panel description. + * @return void + */ + public function get_adminControlPanelAction() { + global $camyks; + $n = $this->formItem->get_objectCount('status=0'); + if ($n == 1) + $camyks->trads['mod_admin_genericcontactformmanager_desc'] = $camyks->trads['mod_admin_genericcontactformmanager_desc1']; + elseif ($n > 1) + $camyks->trads['mod_admin_genericcontactformmanager_desc'] = vsprintf($camyks->trads['mod_admin_genericcontactformmanager_descx'], $n); + } + + /** + * Initialise module object in admin mode. + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check read rights */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Check dependencies */ + if (!isset($camyks->inputs['AdminItemListViewer'])) + return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); + if (!isset($camyks->inputs['TabBuilder'])) + return $this->init_admin_missingPlugin('Input', 'TabBuilder'); + + /* Load configuration */ + $this->config->get(); + + /* Load action to execute */ + $this->mode = isset ($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'; + + /* Execute action */ + switch ($this->mode) { + case 'view_form': + /* mode == view_form */ + $this->init_admin_viewForm(); + break; + case 'edit_form': + /* mode == edit_form */ + $this->init_admin_editForm(); + break; + case 'save_form': + /* mode == save_form */ + $this->init_admin_saveForm(); + break; + case 'delete_form': + /* mode == delete_form */ + $this->init_admin_deleteForm(); + break; + case 'view_subject': + /* mode == view_subject */ + $this->init_admin_viewSubject(); + break; + case 'edit_subject': + /* mode == edit_subject */ + $this->init_admin_editSubject(); + break; + case 'save_subject': + /* mode == save_subject */ + $this->init_admin_saveSubject(); + break; + case 'delete_subject': + /* mode == delete_subject */ + $this->init_admin_deleteSubject(); + break; + case 'edit_config': + /* mode == edit_config */ + $this->init_admin_editConfig(); + break; + case 'save_config': + /* mode == save_config */ + $this->init_admin_saveConfig(); + break; + case 'main': + default: + /* mode == main */ + $this->init_admin_main(); + } + + /* Perform generic initialisation */ + parent::init_admin(); + } + + /* Specific admin mode methods */ + + /** + * Initialise module object in admin/main mode. + * @return void + */ + private function init_admin_main() { + global $camyks; + + /* Load list parameters*/ + $this->load_library('Admin_GenericContactFormManagerFormListParams'); + + /* Initialise object list input */ + $this->formList = &$camyks->inputs['AdminItemListViewer']; + $this->formList->set_params($this->formListParams); + $this->formList->initialise(); + + /* Check for config panel */ + if ($this->check_right(2) !== false) { + /* Load tabs */ + $this->tabBuilder = &$camyks->inputs['TabBuilder']; + $this->tabBuilder->add_tabs(array( + array( + 'name' => 'config', + 'title' => $this->get_translation('tabconfig'), + ), + array( + 'name' => 'forms', + 'title' => $this->get_translation('tabforms'), + ), + )); + $this->tabBuilder->initialise(array('default'=>'forms')); + } + + /* Build interface title */ + $this->adminTitle = $this->title; + + /* Build interface buttons */ + $this->buttons = array( + array( + 'link' => $camyks->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + ); + } + + /** + * Initialise module object in admin/view_form mode. + * @return void + */ + private function init_admin_viewForm() { + global $camyks; + + /* Check item id */ + if (!isset($_REQUEST['form_id'])) + return $this->init_admin_main(); + + /* Load form */ + $this->formItem->id = (int)$_REQUEST['form_id']; + $this->formItem->get(); + $this->formItem->get_fromItems(); + + /* Load interface title */ + $this->adminTitle = $this->get_translation('title_formid', $this->formItem->id); + + /* Build buttons list */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + ); + + /* Update layout */ + $this->selected_layout = 'admin_view_form.html.inc'; + } + + /** + * Initialise module object in admin/edit_form mode. + * @return void + */ + private function init_admin_editForm() { + global $camyks; + + /* Check edition permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load object */ + $this->formItem->id = isset($_REQUEST['form_id']) ? (int)$_REQUEST['form_id'] : 0; + $this->formItem->get(); + $this->formItem->get_fromItems(); + + /* Build edition form */ + $this->editform = new HTMLForm('editform', $this->get_adminLink(array('mode'=>'save_form')), 'POST'); + $this->editform->set_object($this->formItem); + $this->editform->add_hidden('form_id', $this->formItem->id); + $this->editform->add_hidden('locale', $this->formItem->vars['locale']); + $this->editform->add_hidden('ipaddress', $this->formItem->vars['ipaddress']); + + /* Load interface title */ + if ($this->formItem->id == 0) + $this->adminTitle = $this->get_translation('title_newform'); + else + $this->adminTitle = $this->get_translation('title_formid', $this->formItem->id); + + /* Build buttons list */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_form.html.inc'); + } + + /** + * Initialise module object in admin/save_form mode. + * @return void + */ + private function init_admin_saveForm() { + global $camyks; + + /* Check edition permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Check item id */ + if (!isset($_REQUEST['form_id'])) + return $this->init_admin_main(); + + /* Try to save item */ + $this->formItem->id = (int)$_REQUEST['form_id']; + $this->formItem->get_fromHeader(); + if ($this->formItem->save()) { + $this->text = $this->get_translation('form_saved'); + } else { + $this->text = $this->get_translation('form_notsaved'); + } + + /* Update layout */ + $this->set_selectedLayout('admin_form.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/delete_form mode. + * @return void + */ + private function init_admin_deleteForm() { + global $camyks; + + /* Check edition permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Check item id */ + if (!isset($_REQUEST['form_id'])) + return $this->init_admin_main(); + + /* Try to delete item */ + $this->formItem->id = (int)$_REQUEST['form_id']; + if ($this->formItem->delete()){ + $this->text = $this->get_translation('form_deleted'); + } else { + $this->text = $this->get_translation('form_notdeleted'); + } + + /* Update layout */ + $this->set_selectedLayout('admin_form.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/edit_config mode. + * @return void + */ + private function init_admin_editConfig() { + global $camyks; + + /* Check edit configuration permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load config */ + $this->config->get(); + + /* Load external data */ + $this->userList = $camyks->modules['Admin_User']->get_activeUserList(true); + + /* Build configuration form */ + $this->configform = new HTMLForm('configform', $this->get_adminLink(array('mode' => 'save_config')), 'POST'); + $this->configform->set_object($this->config); + $this->configform->add_hidden('notification_recipients_count_', count($this->userList)); + + /* Build window title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + $this->adminTitle .= $this->get_translation('title_config'); + + /* Build button list */ + $this->buttons = array( + array( + 'link' => $camyks->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->configform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_config.html.inc'); + } + + /** + * Initialise module object in admin/save_config mode. + * @return void + */ + private function init_admin_saveConfig() { + global $camyks; + + /* Check edit configuration permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save config */ + $this->config->get_fromHeader(); + if ($this->config->save()) + $this->text = $this->get_translation('config_saved'); + else + $this->text = $this->get_translation('config_notsaved'); + + /* Update layout */ + $this->set_selectedLayout('admin_form.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /* Specific tool methods */ + + /** + * Return forms status list. + * @param boolean $full + * @return array + */ + public function get_formsStatusList($full=false) { + return $this->formItem->get_multiStatusList($full); + } + + /** + * Return form status list. + * @return array + */ + public function get_formStatusList() { + return $this->formItem->get_statusList(); + } + + /** + * Return form status icon list. + * @return array + */ + public function get_formStatusIconList() { + return $this->formItem->get_statusIconList(); + } + + /** + * Send notification emails. + * @return void + */ + private function send_notifications() { + global $camyks; + + /* Check for notifications status */ + if($this->get_configValue('notification_status') == 0) + return true; + + /* Load sender & recipients */ + $sender = $this->get_configValue('notification_sender'); + $recipients = $this->get_configValue('notification_recipients'); + + /* Check sender & recipients */ + if ($sender == '' or count($recipients) == 0) + return true; + + /* Load content */ + $subject = string_html2Text($this->get_translation('notification_emailsubject')); + + /* Send email */ + foreach ($recipients as $rec) { + $this->admin = new AdminUser($rec); + $this->admin->get(); + $content = $this->get_notificationContent(); + mail_sendHTMLMail(array( + 'to' => $this->admin->email, + 'from' => $sender, + 'subject' => $subject, + 'content' => $content, + )); + } + } + + /** + * Return admin email content. + * @return string + */ + private function get_notificationContent() { + global $camyks; + /* Load CSS */ + $css = $camyks->themes[$camyks->get_confValue('site_default_theme')]->get_filePath('email.css'); + + /* Build html page */ + ob_start(); + $page = new HTMLPage(); + $page->add_styleIncludedFile($css); + $page->add_HTMLHeader(); + $this->load_file('html/email_notification.html.inc'); + $page->add_HTMLFooter(); + + $c = ob_get_contents(); + ob_end_clean(); + return $c; + } + + /** + * Update statistics. + * @return boolean success + */ + private function update_statistics() { + global $camyks; + + /* Check for statistics status */ + if($this->get_configValue('statistic_status') == 0) + return true; + + /* Update statistics */ + return $camyks->update_statistic('contact_form', $this->name, 'dated', '', '', ''); + } + + /** + * Return configuration value. + * @param string $item + * @return mixed + */ + public function get_configValue($item) { + if (!isset($this->config->vars)) + $this->config->get(); + return $this->config->vars[$item]; + } + + /* Specific public methods */ + + /** + * Return form list. + * @param array $params + * @return array + */ + public function get_formList($params) { + return $this->formItem->get_list($params); + } + + /** + * Save form from site. + * @return boolean success + */ + public function save_siteForm() { + $this->formItem->id = 0; + $this->formItem->get_fromHeader(); + if($this->formItem->save()) { + $this->send_notifications(); + $this->update_statistics(); + return true; + } + $this->formItem->get_fromItems(); + return false; + } + + /** + * Return form object. + * @return object + */ + public function get_formObject() { + return $this->formItem; + } + + /** + * Return form count. + * @param array $params + * @return integer + */ + public function count_forms($params=array()) { + return $this->formItem->count($params); + } +} +?> diff --git a/plugin/module/Admin_GenericContactFormManager/html/admin.html.inc b/plugin/module/Admin_GenericContactFormManager/html/admin.html.inc index a72aa33a..8be1c4a1 100755 --- a/plugin/module/Admin_GenericContactFormManager/html/admin.html.inc +++ b/plugin/module/Admin_GenericContactFormManager/html/admin.html.inc @@ -1,42 +1,38 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericGuestBookManager Module admin layout : main -*/ -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle) ?> - -check_right(2) === false) : ?> -theme->get_boxContent1Header('height:16px;')?> -msgList->display('head');?> -theme->get_boxContent1Footer(); ?> -theme->get_boxContent2Header()?> -
-msgList->display('list');?> -
-theme->get_boxContent2Footer(); ?> - - -theme->get_boxTabsBar($this->tabBuilder->tabs, - $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header()?> -
-load_file('html/admin_view_config.html.inc');?> -
-
-msgList->display('head');?> -msgList->display('list');?> -
-theme->get_boxContent2Footer(); ?> - -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle) ?> +check_right(2) === false) : ?> + theme->get_boxContent1Header('height:16px;')?> + msgList->display('head'); ?> + theme->get_boxContent1Footer(); ?> + theme->get_boxContent2Header()?> +
+ msgList->display('list'); ?> +
+ theme->get_boxContent2Footer(); ?> + + theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> + theme->get_boxContent2Header()?> +
+ load_file('html/admin_view_config.html.inc'); ?> +
+
+ msgList->display('head'); ?> + msgList->display('list'); ?> +
+ theme->get_boxContent2Footer(); ?> + +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericContactFormManager/html/admin_edit_config.html.inc b/plugin/module/Admin_GenericContactFormManager/html/admin_edit_config.html.inc index 0924a2e1..1ae9336a 100755 --- a/plugin/module/Admin_GenericContactFormManager/html/admin_edit_config.html.inc +++ b/plugin/module/Admin_GenericContactFormManager/html/admin_edit_config.html.inc @@ -1,119 +1,115 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericGuestBookManager Module Admin Layout : edit_config -*/ -global $camyks; -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxContent2Header( )?> -configform->display_header(); ?> -configform->display_hiddens(); ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('formtitle_messages');?> -
- get_translation('formitem_validation')?> - - configform->display_selectInput(array('name'=>'message_validation', 'values'=>$this->config->get_messageValidationList()));?> -
- get_translation('formtitle_notifications');?> -
- get_translation('formitem_status')?> - - configform->display_selectInput(array('name'=>'notification_status', 'values'=>$this->config->get_notificationStatusList()));?> -
- get_translation('formitem_sender')?> - - configform->display_textInput('notification_sender');?> -
- get_translation('formitem_recipients')?> - - - - - - userList as $admin) : ?> - - - - - - - - - - - - - - - -
- login, $this->config->vars['notification_recipients'])?' checked="checked"':'' ?> /> - -
-   -
-
- get_translation('formtitle_statistics');?> -
- get_translation('formitem_status')?> - - configform->display_selectInput(array('name'=>'statistic_status', 'values'=>$this->config->get_statisticStatusList()));?> -
-
- -configform->display_footer(); ?> -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxContent2Header( ); ?> +configform->display_header(); ?> +configform->display_hiddens(); ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_messages'); ?> +
+ get_translation('formitem_validation'); ?> + + configform->display_selectInput(array('name'=>'message_validation', 'values'=>$this->config->get_messageValidationList())); ?> +
+ get_translation('formtitle_notifications'); ?> +
+ get_translation('formitem_status'); ?> + + configform->display_selectInput(array('name'=>'notification_status', 'values'=>$this->config->get_notificationStatusList())); ?> +
+ get_translation('formitem_sender'); ?> + + configform->display_textInput('notification_sender'); ?> +
+ get_translation('formitem_recipients'); ?> + + + + + + userList as $admin) : ?> + + + + + + + + + + + + + + + +
+ login, $this->config->vars['notification_recipients'])?' checked="checked"':'' ?> /> + +
+   +
+
+ get_translation('formtitle_statistics'); ?> +
+ get_translation('formitem_status'); ?> + + configform->display_selectInput(array('name'=>'statistic_status', 'values'=>$this->config->get_statisticStatusList())); ?> +
+
+ +configform->display_footer(); ?> +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericContactFormManager/html/admin_edit_msg.html.inc b/plugin/module/Admin_GenericContactFormManager/html/admin_edit_msg.html.inc index 1c2485ee..d75ecba8 100755 --- a/plugin/module/Admin_GenericContactFormManager/html/admin_edit_msg.html.inc +++ b/plugin/module/Admin_GenericContactFormManager/html/admin_edit_msg.html.inc @@ -1,91 +1,89 @@ - - * CaMykS Version : 1.0a2 - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Jan 2010 - * Last Modif Date : Jan 2010 - * - * Admin_p2cracingGuestBookManager Module admin layout : edit event -*/ -global $camyks; -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxContent2Header()?> - -editform->display_header();?> -editform->display_hiddens();?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-get_translation('formitem_status');?> - -
-msgItem->vars['ipaddress'];?> -
-editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_messageStatusList()));?> -
-get_translation('formitem_date');?> - -editform->display_dateInput(array('name'=>'edate'));?> -
-get_translation('formitem_author');?> - -editform->display_textInput('author');?> -
-get_translation('formitem_email');?> - -editform->display_textInput('email');?> -
-get_translation('formitem_website');?> - -editform->display_textInput('website');?> -
-get_translation('formitem_message');?> - -editform->display_textAreaInput('message');?> -
-
- -editform->display_footer();?> - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxContent2Header()?> + +editform->display_header(); ?> +editform->display_hiddens(); ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + +
+ msgItem->vars['ipaddress']; ?> +
+ editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_messageStatusList())); ?> +
+ get_translation('formitem_date'); ?> + + editform->display_dateInput(array('name'=>'edate')); ?> +
+ get_translation('formitem_author'); ?> + + editform->display_textInput('author'); ?> +
+ get_translation('formitem_email'); ?> + + editform->display_textInput('email'); ?> +
+ get_translation('formitem_website'); ?> + + editform->display_textInput('website'); ?> +
+ get_translation('formitem_message'); ?> + + editform->display_textAreaInput('message'); ?> +
+
+ +editform->display_footer(); ?> + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericContactFormManager/html/admin_view_config.html.inc b/plugin/module/Admin_GenericContactFormManager/html/admin_view_config.html.inc index 56969f0b..beb53930 100755 --- a/plugin/module/Admin_GenericContactFormManager/html/admin_view_config.html.inc +++ b/plugin/module/Admin_GenericContactFormManager/html/admin_view_config.html.inc @@ -1,94 +1,93 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericGuestBookManager Module Admin Layout : view config -*/ -global $camyks; -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('formtitle_messages');?> -
- get_translation('formitem_validation')?> - - config->get_messageValidationValue();?> -
- get_translation('formtitle_notifications');?> -
- get_translation('formitem_status')?> - - config->get_notificationStatusValue();?> -
- get_translation('formitem_sender')?> - - config->vars['notification_sender'];?> -
- get_translation('formitem_recipients')?> - - config->get_notificationRecipientsValue();?> -
- get_translation('formtitle_statistics');?> -
- get_translation('formitem_status')?> - - config->get_statisticStatusValue();?> -
-   -
- theme->get_button(array('url'=>$this->get_adminLink(array('mode'=>'edit_config')), - 'title'=>$camyks->get_translation('modify')));?> -
+ + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_messages'); ?> +
+ get_translation('formitem_validation')?> + + config->get_messageValidationValue(); ?> +
+ get_translation('formtitle_notifications'); ?> +
+ get_translation('formitem_status')?> + + config->get_notificationStatusValue(); ?> +
+ get_translation('formitem_sender')?> + + config->vars['notification_sender']; ?> +
+ get_translation('formitem_recipients')?> + + config->get_notificationRecipientsValue(); ?> +
+ get_translation('formtitle_statistics'); ?> +
+ get_translation('formitem_status')?> + + config->get_statisticStatusValue(); ?> +
+   +
+ theme->get_button(array( + 'url' => $this->get_adminLink(array('mode'=>'edit_config')), + 'title' => $camyks->get_translation('modify'), + )); ?> +
diff --git a/plugin/module/Admin_GenericContactFormManager/html/admin_view_msg.html.inc b/plugin/module/Admin_GenericContactFormManager/html/admin_view_msg.html.inc index 86e0ca50..b47d0166 100755 --- a/plugin/module/Admin_GenericContactFormManager/html/admin_view_msg.html.inc +++ b/plugin/module/Admin_GenericContactFormManager/html/admin_view_msg.html.inc @@ -1,87 +1,84 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericGuestBookManager Module admin layout : view msg -*/ -global $camyks; -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxContent2Header()?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-get_translation('formitem_status');?> - -
-msgItem->vars['ipaddress'];?> -
-msgItem->get_statusValue();?> -
-get_translation('formitem_date');?> - -msgItem->vars['edate']);?> -
-get_translation('formitem_author');?> - -msgItem->vars['author'];?> -
-get_translation('formitem_email');?> - -msgItem->vars['email'];?> -
-get_translation('formitem_website');?> - -msgItem->vars['website'] != '') : ?> -msgItem->vars['website'];?> - -
-get_translation('formitem_message');?> - -msgItem->vars['message'];?> -
-
- -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxContent2Header()?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + +
+ msgItem->vars['ipaddress']; ?> +
+ msgItem->get_statusValue(); ?> +
+ get_translation('formitem_date'); ?> + + msgItem->vars['edate']); ?> +
+ get_translation('formitem_author'); ?> + + msgItem->vars['author']; ?> +
+ get_translation('formitem_email'); ?> + + msgItem->vars['email']; ?> +
+ get_translation('formitem_website'); ?> + + msgItem->vars['website'] != '') : ?> + msgItem->vars['website']; ?> + +
+ get_translation('formitem_message'); ?> + + msgItem->vars['message']; ?> +
+
+ +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericContactFormManager/html/email_notification.html.inc b/plugin/module/Admin_GenericContactFormManager/html/email_notification.html.inc index 72dde137..c6ca0379 100755 --- a/plugin/module/Admin_GenericContactFormManager/html/email_notification.html.inc +++ b/plugin/module/Admin_GenericContactFormManager/html/email_notification.html.inc @@ -1,27 +1,27 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericGuestBookManager Module layout : email notification -*/ -global $camyks; -?> -

-admin->get_nameDisplay();?>, -

-

- get_translation('notification_emailcontent1', - array($camyks->get_confValue('url'), - $camyks->get_confValue('title')));?> -

-

- get_translation('notification_emailsign'); ?>
- get_confValue('url');?> -

\ No newline at end of file + + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +

+ admin->get_nameDisplay(); ?>, +

+

+ get_translation('notification_emailcontent1', array( + $camyks->get_confValue('url'), + $camyks->get_confValue('title'), + ));?> +

+

+ get_translation('notification_emailsign'); ?>
+ get_confValue('url'); ?> +

diff --git a/plugin/module/Admin_GenericContactFormManager/js/usersmanager_accounteditor.js b/plugin/module/Admin_GenericContactFormManager/js/usersmanager_accounteditor.js deleted file mode 100755 index ef0e2ec4..00000000 --- a/plugin/module/Admin_GenericContactFormManager/js/usersmanager_accounteditor.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CaMykS Engine - * Developed by : skymac.org - * Author : sky - * CaMykS Version : 1.0a2 - * Object Version : 1.0 - * Object Type : Plugin / Module Javascript - * Create Date : Jan 2009 - * Last Modif Date : Jan 2009 - * - * UsersManager Account Editor scripts - */ - -function AccountEditor(name, form) { - this._name = name; - this._form = form; - this._passwordPanel = null; - - /* - * initialisation method - * @return void - * @access public - */ - this.initialise = function() { - /* get form object */ - this._form = eval('document.'+this._form); - - /* get password panel element */ - if (document.getElementById('password_panel')) - this._passwordPanel = document.getElementById('password_panel'); - - } - - /* - * update password panel status - * return void - * @access public - */ - this.update_passwordPanel = function() { - /* get change password value */ - change = this._form.change_password.options[this._form.change_password.options.selectedIndex].value; - if ( this._passwordPanel ) - this._passwordPanel.style.display = (change==1?'block':'none'); - } -} diff --git a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerConfig.php.inc b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerConfig.php.inc index 48ccd867..4c0fe7ee 100755 --- a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerConfig.php.inc +++ b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerConfig.php.inc @@ -1,103 +1,105 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Config - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericContactFormManager configuration file +/** + * @brief Admin_GenericContactFormManager Module, configuration library. + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -class Admin_GenericContactFormManagerConfig extends ModuleConfig { - /* - * constructor - * @param string $name - * @param Module $parent - */ - function Admin_GenericContactFormManagerConfig ( $name, &$parent ) { - parent::ModuleConfig($name, $parent); +/** + * Admin_GenericContactFormManagerConfig class. + */ +final class Admin_GenericContactFormManagerConfig extends PluginConfig { + /** + * Class constructor. + * @param string $name + * @param Module $parent + * @return void + */ + public function __construct($name, &$parent) { + parent::__construct($name, $parent); + + /* site configuration */ + $this->add_newItem('notification_status', 'integer', 0); + $this->add_newItem('notification_sender', 'sender', ''); + $this->add_newItem('notification_recipients', 'array', array()); - /* site configuration */ - $this->add_newItem('notification_status', 'integer', 0); - $this->add_newItem('notification_sender', 'sender', ''); - $this->add_newItem('notification_recipients', 'array', array()); + $this->add_newItem('statistic_status', 'intger', 0); + + /* generic initialisation */ + parent::init_config(); + } - $this->add_newItem('statistic_status', 'intger', 0); + /* specific tool methods */ - /* generic initialisation */ - parent::init_config(); - } + /** + * Return notification status list. + * @return array + */ + public function get_notificationStatusList() { + return array( + 0 => $this->get_translation('confignotifstatus_disabled'), + 1 => $this->get_translation('confignotifstatus_enabled'), + ); + } - /* specific tool methods */ - - /* - * return notification status list - * @return array - * @access private - */ - function get_notificationStatusList() { - return array(0 => $this->get_translation('confignotifstatus_disabled'), - 1 => $this->get_translation('confignotifstatus_enabled')); - } + /** + * Return notifications status value. + * @param integer $value + * @return string + */ + public function get_notificationStatusValue($value=false) { + $l = $this->get_notificationStatusList(); + if ($value === false) + return $l[$this->vars['notification_status']]; + return $l[$value]; + } - /* - * return notifications status value - * @param integer $value - * @return string - * @access private - */ - function get_notificationStatusValue($value=false) { - $l = $this->get_notificationStatusList(); - if ($value===false) - return $l[$this->vars['notification_status']]; - return $l[$value]; - } + /** + * Return notifications reciepients value. + * @return string + */ + public function get_notificationRecipientsValue() { + global $camyks; - /* - * return notifications reciepients value - * @return string - * @access private - */ - function get_notificationRecipientsValue() { - global $camyks; - - if ( count($this->vars['notification_recipients']) == 0) - return $this->get_translation('confignotifrecipient_none'); + if (count($this->vars['notification_recipients']) == 0) + return $this->get_translation('confignotifrecipient_none'); - $s = array(); - $users = $camyks->modules['Admin_User']->get_activeUserList(true); - foreach ($this->vars['notification_recipients'] as $login) { - if (isset($users[$login])) - $s[] = $users[$login]->get_nameDisplay(); + $s = array(); + $users = $camyks->modules['Admin_User']->get_activeUserList(true); + foreach ($this->vars['notification_recipients'] as $login) { + if (isset($users[$login])) + $s[] = $users[$login]->get_nameDisplay(); + } + return implode(', ', $s); } - return implode(', ', $s); - } - /* - * return statistic status list - * @return array - * @access private - */ - function get_statisticStatusList() { - return array(0 => $this->get_translation('configstatstatus_disabled'), - 1 => $this->get_translation('configstatstatus_enabled')); - } + /** + * Return statistic status list. + * @return array + */ + public function get_statisticStatusList() { + return array( + 0 => $this->get_translation('configstatstatus_disabled'), + 1 => $this->get_translation('configstatstatus_enabled'), + ); + } - /* - * return notifications status value - * @param integer $value - * @return string - * @access private - */ - function get_statisticStatusValue($value=false) { - $l = $this->get_statisticStatusList(); - if ($value===false) - return $l[$this->vars['statistic_status']]; - return $l[$value]; - } + /** + * Return notifications status value. + * @param integer $value + * @return string + */ + public function get_statisticStatusValue($value=false) { + $l = $this->get_statisticStatusList(); + if ($value === false) + return $l[$this->vars['statistic_status']]; + return $l[$value]; + } } -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerForm.php.inc b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerForm.php.inc index fd8cc1d4..8f4a77ab 100755 --- a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerForm.php.inc +++ b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerForm.php.inc @@ -1,230 +1,226 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Nov 2010 - * Last Modif Date : Nov 2010 - * - * Admin_GenericContactFormManagerForm library for Admin_GenericContactFormManager module - */ - -class Admin_GenericContactFormManagerForm extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericContactFormManagerForm( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - - /* admin items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('ipaddress', 'db', 'text', 'varchar', 48, ''); - $this->add_newItem('edate', 'db', 'date', 'bigint unsigned', '', time()); - $this->add_newItem('locale', 'db', 'text', 'varchar', 3, ''); - $this->add_newItem('hidden', 'db', 'text', 'varchar', 255, ''); - $this->add_newItem('account', 'db', 'int', 'bigint unsigned', '', 0); - - /* request items */ - $this->add_newItem('type', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('company', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('firstname', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('lastname', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('email', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('subject', 'db', 'int', 'bigint unsigned', '', 0); - $this->add_newItem('subject_title', 'db', 'text', 'varchar', 255, ''); - $this->add_newItem('request', 'db', 'text', 'text', '', ''); - $this->add_newItem('attachment', 'file', 'attachments', '', '', ''); - - /* answer items */ - - $this->add_newItem('answer_date', 'db', 'date', 'bigint', '', 0); - $this->add_newItem('answer_admin', 'db', 'text', 'varchar', 16, ''); - $this->add_newItem('answer_comment', 'db', 'text', 'text', '', ''); - - - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite Module Library methods */ - - /* - * check object data - * @return boolean success - * @access private - */ - function check_data () { - global $camyks; - - /* trim author value */ - $this->_libItems['author']->value = trim($this->_libItems['author']->value); - /* check author value */ - if ($this->_libItems['author']->value == '') { - $this->_libError = $this->get_translation('form_saveerror_authorempty'); - return false; - } - - /* trim email value */ - $this->_libItems['email']->value = trim($this->_libItems['email']->value); - /* check form value */ - if ($this->_libItems['email']->value == '') { - $this->_libError = $this->get_translation('form_saveerror_emailempty'); - return false; - } - if (mail_isValidEmail($this->_libItems['email']->value)==false) { - $this->_libError = $this->get_translation('form_saveerror_emailinvalid'); - return false; - } - - /* trim form value */ - $this->_libItems['form']->value = trim(strip_tags($this->_libItems['form']->value)); - /* check form value */ - if ($this->_libItems['form']->value == '') { - $this->_libError = $this->get_translation('form_saveerror_formempty'); - return false; - } - - /* complete new object data */ - if ( $this->id == 0 ) { - $this->_libItems['status']->value = 0; - $this->_libItems['edate']->initialise(); - $this->_libItems['ipaddress']->value = client_getIp(); - $this->_libItems['locale']->value = $camyks->current_language; - } - return true; - } - - /* - * build SQL condition - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition( $params ) { - $query = array(); - - /* check status */ - if ( isset($params['status']) and $params['status']!=-1) - $query[] = 'status = '.$params['status']; - - return implode(' AND ', $query); - } - - /* specific methods */ - - /* - * return objects status list - * @param boolean $full - * @return array - * @access private - */ - function get_multiStatusList($full=false) { - $list = array(); - if ($full) - $list[-1] = $this->get_translation('formsstatus_all'); - $list[0] = $this->get_translation('formsstatus_disabled'); - $list[1] = $this->get_translation('formsstatus_enabled'); - $list[2] = $this->get_translation('formsstatus_pending'); - return $list; - } - - /* - * return object status list - * @return array - * @access private - */ - function get_statusList() { - return array(0 => $this->get_translation('formstatus_disabled'), - 1 => $this->get_translation('formstatus_enabled'), - 2 => $this->get_translation('formstatus_pending')); - } - - /* - * return object status value - * @param mixed $status - * @return string - */ - function get_statusValue($status=false) { - $list = $this->get_statusList(); - if ($status === false) - $status = $this->vars['status']; - return $list[$status]; - } - - /* - * return object status icon list - * @return array - * @access private - */ - function get_statusIconList() { - $theme = &$this->_libParent->theme; - return array(0 =>'', - 1 =>'', - 2 =>''); - } - - /* - * return object status icon - * @return array - * @access private - */ - function get_statusIcon($status=false) { - $icons = $this->get_statusIconList(); - if ($status === false) - return $icons[$this->vars['status']]; - return $icons[$status]; - } - - /* - * return form list with given params - * @params array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - $p = array('status'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); - $params = array_merge($p, $params); - $w = $this->build_whereStatement($params); - return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); - } - - /* - * return form count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('status'=>-1); - $params = array_merge($p, $params); - return $this->get_objectCount($this->build_whereStatement($params)); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - - /* check status */ - if ( is_string($params['status']) and $params['status'] != '') - $w[] = 'status '.$params['status']; - elseif($params['status'] != -1 ) - $w[] = 'status = '.$params['status']; - - /* return result */ - return implode(' and ', $w); - } -} -?> \ No newline at end of file + + * @version 1.0.1.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericContactFormManagerForm class. + */ +final class Admin_GenericContactFormManagerForm extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct ($id, $module); + + /* Admin items */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('ipaddress', 'db', 'text', 'varchar', 48, ''); + $this->add_newItem('edate', 'db', 'date', 'bigint unsigned', '', time()); + $this->add_newItem('locale', 'db', 'text', 'varchar', 3, ''); + $this->add_newItem('hidden', 'db', 'text', 'varchar', 255, ''); + $this->add_newItem('account', 'db', 'int', 'bigint unsigned', '', 0); + + /* Request items */ + $this->add_newItem('type', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('company', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('firstname', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('lastname', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('email', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('subject', 'db', 'int', 'bigint unsigned', '', 0); + $this->add_newItem('subject_title', 'db', 'text', 'varchar', 255, ''); + $this->add_newItem('request', 'db', 'text', 'text', '', ''); + $this->add_newItem('attachment', 'file', 'attachments', '', '', ''); + + /* Answer items */ + $this->add_newItem('answer_date', 'db', 'date', 'bigint', '', 0); + $this->add_newItem('answer_admin', 'db', 'text', 'varchar', 16, ''); + $this->add_newItem('answer_comment', 'db', 'text', 'text', '', ''); + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override Module Library methods */ + + /** + * Check object data + * @return boolean success + */ + public function check_data() { + global $camyks; + + /* trim author value */ + $this->_libItems['author']->value = trim($this->_libItems['author']->value); + + /* Check author value */ + if ($this->_libItems['author']->value == '') { + $this->_libError = $this->get_translation('message_saveerror_authorempty'); + return false; + } + + /* Trim email value */ + $this->_libItems['email']->value = trim($this->_libItems['email']->value); + /* Check form value */ + if ($this->_libItems['email']->value == '') { + $this->_libError = $this->get_translation('message_saveerror_emailempty'); + return false; + } + if (mail_isValidEmail($this->_libItems['email']->value)==false) { + $this->_libError = $this->get_translation('message_saveerror_emailinvalid'); + return false; + } + + /* trim form value */ + $this->_libItems['request']->value = trim(strip_tags($this->_libItems['request']->value)); + /* Check form value */ + if ($this->_libItems['request']->value == '') { + $this->_libError = $this->get_translation('message_saveerror_formempty'); + return false; + } + + /* Complete new object data */ + if ($this->id == 0) { + $this->_libItems['status']->value = 0; + $this->_libItems['edate']->initialise(); + $this->_libItems['ipaddress']->value = client_getIp(); + $this->_libItems['locale']->value = $camyks->current_language; + } + return true; + } + + /** + * Build SQL condition. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + $query = array(); + + /* Check status */ + if (isset($params['status']) and $params['status']!=-1) + $query[] = 'status = '.$params['status']; + + return implode(' AND ', $query); + } + + /* Specific methods */ + + /** + * Return objects status list + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if ($full) + $list[-1] = $this->get_translation('formsstatus_all'); + $list[0] = $this->get_translation('formsstatus_disabled'); + $list[1] = $this->get_translation('formsstatus_enabled'); + $list[2] = $this->get_translation('formsstatus_pending'); + return $list; + } + + /** + * Return object status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('formstatus_disabled'), + 1 => $this->get_translation('formstatus_enabled'), + 2 => $this->get_translation('formstatus_pending'), + ); + } + + /** + * Return object status value. + * @param mixed $status + * @return string + */ + public function get_statusValue($status=false) { + $list = $this->get_statusList(); + if ($status === false) + $status = $this->vars['status']; + return $list[$status]; + } + + /** + * Return object status icon list. + * @return array + */ + public function get_statusIconList() { + $theme = &$this->_libParent->theme; + return array( + 0 =>'', + 1 =>'', + 2 =>'', + ); + } + + /** + * Return object status icon. + * @return array + */ + public function get_statusIcon($status=false) { + $icons = $this->get_statusIconList(); + if ($status === false) + return $icons[$this->vars['status']]; + return $icons[$status]; + } + + /** + * Return form list with given params. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + $p = array('status'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); + $params = array_merge($p, $params); + $w = $this->build_whereStatement($params); + return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); + } + + /** + * Return form count with given params. + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + $p = array('status'=>-1); + $params = array_merge($p, $params); + return $this->get_objectCount($this->build_whereStatement($params)); + } + + /** + * Build where statement from params. + * @param array $params + * @return string + */ + private function build_whereStatement($params=array()) { + $w = array(); + + /* Check status */ + if (is_string($params['status']) and $params['status'] != '') + $w[] = 'status '.addslashes($params['status']); + elseif($params['status'] != -1) + $w[] = 'status = '.$params['status']; + + /* Return result */ + return implode(' and ', $w); + } +} +?> diff --git a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerFormListParams.php.inc b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerFormListParams.php.inc index 03e9eca5..6c7d3ced 100755 --- a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerFormListParams.php.inc +++ b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerFormListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Nov 2010 - * Last Modif Date : Nov 2010 - * - * Admin_GenericContactFormManager form list parameters +/** + * @brief Admin_GenericContactFormManager Module, form list parameters. + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -22,27 +21,28 @@ $this->add_JSScript('var deleteFormUrl="'.$camyks->get_adminJSLink($this->name, $this->listRegistrationLink = $camyks->get_adminLink($this->name, array('mode'=>'list_registration', 'form_id'=>'%s')); /* build main parameters */ -$this->formListParams = array('name'=>'formList', 'useSession'=>true, 'object'=>&$this->formItem); +$this->formListParams = array('name'=>'formList', 'useSession'=>true, 'object'=>&$this->formItem, 'listlinks'=>array()); /* build head parameters */ -$this->formListParams['headselectors'] = array('page'=> array('title'=>$this->get_translation('itempage'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->get_formsStatusList(true), 'default'=>-1)); +$this->formListParams['headselectors'] = array( + 'page' => array('title'=>$this->get_translation('itempage'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->get_formsStatusList(true), 'default'=>-1), +); /* build sort parameters */ $this->formListParams['sort'] = array('allowed'=>false, 'default'=>'edate', 'defaultway'=>'desc'); /* build column parameters */ -$this->formListParams['listlinks'] = array(); -$this->formListParams['listcolumns'] = array('status'=>array('title'=>'', 'columntype'=>'list', 'values'=>$this->get_formStatusIconList(), 'style'=>'width:20px;'), - 'edate'=>array('title'=>$this->get_translation('header_date'), 'columntype'=>'date', 'mode'=>'shortwithhours', 'style'=>'width:100px;'), - 'author'=>array('title'=>$this->get_translation('header_author'), 'columntype'=>'text'), - 'view'=>array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewFormLink, 'url_title'=>$this->get_translation('viewform'), 'style'=>'width:12px;')); +$this->formListParams['listcolumns'] = array( + 'status' => array('title'=>'', 'columntype'=>'list', 'values'=>$this->get_formStatusIconList(), 'style'=>'width:20px;'), + 'edate' => array('title'=>$this->get_translation('header_date'), 'columntype'=>'date', 'mode'=>'shortwithhours', 'style'=>'width:100px;'), + 'author' => array('title'=>$this->get_translation('header_author'), 'columntype'=>'text'), + 'view' => array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewFormLink, 'url_title'=>$this->get_translation('viewform'), 'style'=>'width:12px;'), +); /* add right's dependent columns and link lines */ if ($this->check_right(1)===true) { - $this->formListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editFormLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editform')); - $this->formListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteFormLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deleteform')); - /* $this->formListParams['listlinks']['new'] = array('title'=>$this->get_translation('addnewform'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editFormLink, 0), 'titlecolumn'=>'edate', 'buttoncolumn'=>'edit'); */ + $this->formListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editFormLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editform')); + $this->formListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteFormLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deleteform')); } - -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubject.php.inc b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubject.php.inc index 9e29fd2c..ef793e1e 100755 --- a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubject.php.inc +++ b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubject.php.inc @@ -1,168 +1,156 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Nov 2010 - * Last Modif Date : Nov 2010 - * - * Admin_GenericContactFormManagerSubject library for Admin_GenericContactFormManager module - */ - -class Admin_GenericContactFormManagerSubject extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericContactFormManagerSubject( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - - /* main items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('title', 'db', 'text', 'varchar', 48, '', true); - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite methods */ - - /* - * check object data - * @return boolean success - * @access private - */ - function check_data () { - global $camyks; - return true; - } - - /* - * build SQL condition - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition( $params ) { - $query = array(); - - /* check status */ - if ( isset($params['status']) and $params['status']!=-1) - $query[] = 'status = '.$params['status']; - - return implode(' AND ', $query); - } - - /* specific methods */ - - /* - * return objects status list - * @param boolean $full - * @return array - * @access private - */ - function get_multiStatusList($full=false) { - $list = array(); - if ($full) - $list[-1] = $this->get_translation('subjectsstatus_all'); - $list[0] = $this->get_translation('subjectsstatus_disabled'); - $list[1] = $this->get_translation('subjectsstatus_enabled'); - return $list; - } - - /* - * return object status list - * @return array - * @access private - */ - function get_statusList() { - return array(0 => $this->get_translation('subjectstatus_disabled'), - 1 => $this->get_translation('subjectstatus_enabled')); - } - - /* - * return object status value - * @param mixed $status - * @return string - */ - function get_statusValue($status=false) { - $list = $this->get_statusList(); - if ($status === false) - $status = $this->vars['status']; - return $list[$status]; - } - - /* - * return object status icon list - * @return array - * @access private - */ - function get_statusIconList() { - $theme = &$this->_libParent->theme; - return array(0 =>'', - 1 =>''); - } - - /* - * return object status icon - * @return array - * @access private - */ - function get_statusIcon($status=false) { - $icons = $this->get_statusIconList(); - if ($status === false) - return $icons[$this->vars['status']]; - return $icons[$status]; - } - - /* - * return subject list with given params - * @params array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - $p = array('status'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); - $params = array_merge($p, $params); - $w = $this->build_whereStatement($params); - return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); - } - - /* - * return subject count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('status'=>-1); - $params = array_merge($p, $params); - return $this->get_objectCount($this->build_whereStatement($params)); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - - /* check status */ - if ( is_string($params['status']) and $params['status'] != '') - $w[] = 'status '.$params['status']; - elseif($params['status'] != -1 ) - $w[] = 'status = '.$params['status']; - - /* return result */ - return implode(' and ', $w); - } -} -?> \ No newline at end of file + + * @version 1.0.1.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericContactFormManagerSubject class. + */ +final class Admin_GenericContactFormManagerSubject extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* main items */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('title', 'db', 'text', 'varchar', 48, '', true); + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override methods */ + + /** + * Build SQL condition. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + $query = array(); + + /* check status */ + if (isset($params['status']) and $params['status']!=-1) + $query[] = 'status = '.$params['status']; + + return implode(' AND ', $query); + } + + /* Specific data methods */ + + /** + * Return objects status list. + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if ($full) + $list[-1] = $this->get_translation('subjectsstatus_all'); + $list[0] = $this->get_translation('subjectsstatus_disabled'); + $list[1] = $this->get_translation('subjectsstatus_enabled'); + return $list; + } + + /** + * Return object status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('subjectstatus_disabled'), + 1 => $this->get_translation('subjectstatus_enabled'), + ); + } + + /** + * Return object status value. + * @param mixed $status + * @return string + */ + public function get_statusValue($status=false) { + $list = $this->get_statusList(); + if ($status === false) + $status = $this->vars['status']; + return $list[$status]; + } + + /** + * Return object status icon list. + * @return array + */ + public function get_statusIconList() { + $theme = &$this->_libParent->theme; + return array( + 0 => '', + 1 => ''); + } + + /** + * Return object status icon. + * @return array + */ + public function get_statusIcon($status=false) { + $icons = $this->get_statusIconList(); + if ($status === false) + return $icons[$this->vars['status']]; + return $icons[$status]; + } + + /** + * Return subject list with given params. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + $p = array('status'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); + $params = array_merge($p, $params); + $w = $this->build_whereStatement($params); + return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); + } + + /** + * Return subject count with given params. + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + $p = array('status'=>-1); + $params = array_merge($p, $params); + return $this->get_objectCount($this->build_whereStatement($params)); + } + + /** + * Build where statement from params + * @param array $params + * @return string + */ + private function build_whereStatement($params=array()) { + $w = array(); + + /* check status */ + if (is_string($params['status']) and $params['status'] != '') + $w[] = 'status '.addslashes($params['status']); + elseif($params['status'] != -1) + $w[] = 'status = '.$params['status']; + + /* Return result */ + return implode(' and ', $w); + } +} +?> diff --git a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubjectListParams.php.inc b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubjectListParams.php.inc index 01ed0add..65e154fe 100755 --- a/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubjectListParams.php.inc +++ b/plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubjectListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericContactFormManager subject list parameters +/** + * @brief Admin_GenericContactFormManager Module, subject list parameters. + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -19,30 +18,33 @@ $this->viewSubjectLink = $camyks->get_adminLink($this->name, array('mode'=>'view $this->deleteSubjectLink = 'javascript:adminengine_confirmRedirect(deleteSubjectUrl+%s, deleteSubjectSubject);'; $this->add_JSScript('var deleteSubjectSubject="'.string_html2Text($this->get_translation('deletesubjectsubject')).'";'); $this->add_JSScript('var deleteSubjectUrl="'.$camyks->get_adminJSLink($this->name, array('mode'=>'delete_subject', 'subject_id'=>'')).'";'); -$this->listRegistrationLink = $camyks->get_adminLink($this->name, array('mode'=>'list_registration', 'subject_id'=>'%s')); +$this->listSubjectLink = $camyks->get_adminLink($this->name, array('mode'=>'list_registration', 'subject_id'=>'%s')); /* build main parameters */ -$this->subjectListParams = array('name'=>'subjectList', 'useSession'=>true, 'object'=>&$this->subjectItem); +$this->subjectListParams = array('name'=>'subjectList', 'useSession'=>true, 'object'=>&$this->subjectItem, 'listlinks'=>array()); /* build head parameters */ -$this->subjectListParams['headselectors'] = array('page'=> array('title'=>$this->get_translation('itempage'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->get_subjectsStatusList(true), 'default'=>-1)); +$this->subjectListParams['headselectors'] = array( + 'page' => array('title'=>$this->get_translation('itempage'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->get_subjectsStatusList(true), 'default'=>-1), +); /* build sort parameters */ $this->subjectListParams['sort'] = array('allowed'=>false, 'default'=>'edate', 'defaultway'=>'desc'); /* build column parameters */ -$this->subjectListParams['listlinks'] = array(); -$this->subjectListParams['listcolumns'] = array('status'=>array('title'=>'', 'columntype'=>'list', 'values'=>$this->get_subjectStatusIconList(), 'style'=>'width:20px;'), - 'edate'=>array('title'=>$this->get_translation('header_date'), 'columntype'=>'date', 'mode'=>'shortwithhours', 'style'=>'width:100px;'), - 'author'=>array('title'=>$this->get_translation('header_author'), 'columntype'=>'text'), - 'view'=>array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewSubjectLink, 'url_title'=>$this->get_translation('viewsubject'), 'style'=>'width:12px;')); +$this->subjectListParams['listcolumns'] = array( + 'status' => array('title'=>'', 'columntype'=>'list', 'values'=>$this->get_subjectStatusIconList(), 'style'=>'width:20px;'), + 'edate' => array('title'=>$this->get_translation('header_date'), 'columntype'=>'date', 'mode'=>'shortwithhours', 'style'=>'width:100px;'), + 'author' => array('title'=>$this->get_translation('header_author'), 'columntype'=>'text'), + 'view' => array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewSubjectLink, 'url_title'=>$this->get_translation('viewsubject'), 'style'=>'width:12px;'), +); /* add right's dependent columns and link lines */ if ($this->check_right(1)===true) { - $this->subjectListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editSubjectLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editsubject')); - $this->subjectListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteSubjectLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletesubject')); - /* $this->subjectListParams['listlinks']['new'] = array('title'=>$this->get_translation('addnewsubject'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editSubjectLink, 0), 'titlecolumn'=>'edate', 'buttoncolumn'=>'edit'); */ + $this->subjectListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editSubjectLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editsubject')); + $this->subjectListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteSubjectLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletesubject')); + $this->subjectListParams['listlinks']['new'] = array('title'=>$this->get_translation('addnewsubject'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editSubjectLink, 0), 'titlecolumn'=>'edate', 'buttoncolumn'=>'edit'); } -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_GenericContactFormManager/locale/data/translation_fr.php.inc b/plugin/module/Admin_GenericContactFormManager/locale/data/translation_fr.php.inc deleted file mode 100755 index 711aa726..00000000 --- a/plugin/module/Admin_GenericContactFormManager/locale/data/translation_fr.php.inc +++ /dev/null @@ -1,19 +0,0 @@ - - * CaMykS Version : 1.0a2 - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Feb 2009 - * Last Modif Date : Mar 2009 - * - * Admin_p2cracingEventManager french dictionnary extension -*/ - -$this->trads['mod_admin_p2cracingeventmanager_registrationerror_emptyname'] = 'Vous devez inscrire vos noms et prénoms.'; -$this->trads['mod_admin_p2cracingeventmanager_registrationerror_emptycontact'] = 'Pour pouvoir vous joindre, vous devez laisser soit votre e-mail soit votre téléphone.'; -$this->trads['mod_admin_p2cracingeventmanager_registrationerror_emptyphone'] = 'Le téléphone est obligatoire.'; - -?> \ No newline at end of file diff --git a/plugin/module/Admin_GenericContactFormManager/locale/translation_fr.php.inc b/plugin/module/Admin_GenericContactFormManager/locale/translation_fr.php.inc index 00bd4cae..5b5485ca 100755 --- a/plugin/module/Admin_GenericContactFormManager/locale/translation_fr.php.inc +++ b/plugin/module/Admin_GenericContactFormManager/locale/translation_fr.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Nov 2010 - * Last Modif Date : Nov 2010 - * - * Admin_GenericContactFormManager french dictionnary +/** + * @brief Admin_GenericContactFormManager Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Nov 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ $this->trads['mod_admin_genericcontactformmanager_title'] = 'Formulaires de contact'; $this->trads['mod_admin_genericcontactformmanager_desc'] = 'Gestion des requêtes des visiteurs'; @@ -103,4 +102,4 @@ $this->trads['mod_admin_genericcontactformmanager_message_saveerror_emailinvalid /* statistics */ $this->trads['mod_admin_genericcontactformmanager_stat_contactform_msg'] = 'Fomulaires de contact'; $this->trads['mod_admin_genericcontactformmanager_stat_contactform_msg_main'] = 'requête(s) envoyée(s).'; -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_GenericDirectoryManager/Admin_GenericDirectoryManager.php.inc b/plugin/module/Admin_GenericDirectoryManager/Admin_GenericDirectoryManager.php.inc index a505d682..ce6bce57 100755 --- a/plugin/module/Admin_GenericDirectoryManager/Admin_GenericDirectoryManager.php.inc +++ b/plugin/module/Admin_GenericDirectoryManager/Admin_GenericDirectoryManager.php.inc @@ -1,560 +1,572 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Jul 2010 - * Last Modif Date : Jul 2010 - * History : - * * 10-07-13 : Initial files - * - * Admin_GenericDirectoryManager - */ - -class Admin_GenericDirectoryManager extends Module { - /* variables */ - var $config; - var $contactItem; - var $categoryItem; - var $contactList; - var $categoryList; - - /* - * constructor - * @param string $path_type - */ - function Admin_GenericDirectoryManager ( $path_type ) { - parent::Module('Admin_GenericDirectoryManager', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'content'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Generic'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* load plugin libraries */ - $this->libs[] = 'Admin_GenericDirectoryManagerContact.php.inc'; - $this->libs[] = 'Admin_GenericDirectoryManagerCategory.php.inc'; - $this->get_PHPLibs(); - - /* initialise plugin libraries */ - $this->contactItem = new Admin_GenericDirectoryManagerContact(0, $this); - $this->categoryItem = new Admin_GenericDirectoryManagerCategory(0, $this); - - /* initialise plugin variables */ - $this->contactList = null; - $this->categoryList = null; - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - return ( $this->contactItem->install() - and $this->categoryItem->install() and parent::install()); - } - - /* - * unintall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - return parent::uninstall(); - } - - /* - * check module installation - * @return boolean result - * @access private - */ - function is_installed () { - return $this->contactItem->is_installed(); - } - - /* - * get module rights - * @return void - * @access private - */ - function get_rights() { - global $camyks; - $this->rights[0] = array('name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> true); - $this->rights[1] = array('name'=>'category', - 'title'=> $this->get_translation('rights_category'), - 'default'=> false); - $this->rights[2] = array('name'=>'contact', - 'title'=> $this->get_translation('rights_contact'), - 'default'=> false); - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - - /* check user rights */ - if ( $this->check_right(0) === false ) - return $this->init_admin_accessDenied(); - - /* check dependencies */ - if(!isset($camyks->inputs['TabBuilder'])) - return $this->init_admin_missingPlugin('Input', 'TabBuilder'); - if (!isset($camyks->inputs['AdminItemListViewer'])) - return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); - if (!isset($camyks->inputs['TinyMCEv3'])) - return $this->init_admin_missingPlugin('Input', 'TinyMCEv3'); - - /* get informations */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'main' ); - - switch ( $this->mode ) { - case 'edit_category': - /* mode == edit_category */ - $this->init_admin_edit_category(); - break; - case 'save_category': - /* mode == save_category */ - $this->init_admin_save_category(); - break; - case 'delete_category': - /* mode == delete_category */ - $this->init_admin_delete_category(); - break; - case 'edit_contact': - /* mode == edit_contact */ - $this->init_admin_edit_contact(); - break; - case 'save_contact': - /* mode == save_contact */ - $this->init_admin_save_contact(); - break; - case 'delete_contact': - /* mode == delete_contact */ - $this->init_admin_delete_contact(); - break; - case 'main': - default: - /* mode == main */ - $this->init_admin_main(); - } - - parent::init_admin(); - } - - /* - * display module object in admin mode - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* specific admin mode methods */ - - /* - * init module object in admin/main mode - * @return void - * @access private - */ - function init_admin_main() { - global $camyks; - - /* get help */ - $this->get_help(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - - /* build contact tab */ - $this->load_file('lib/Admin_GenericDirectoryManagerContactListParams.php.inc'); - $this->listContact = new AdminItemListViewer('camyks'); - $this->listContact->set_params($this->contactListParams); - $this->listContact->initialise(); - - /* build category tab */ - if ( $this->check_right(1) === true ) { - $this->load_file('lib/Admin_GenericDirectoryManagerCategoryListParams.php.inc'); - $this->listCategory = new AdminItemListViewer('camyks'); - $this->listCategory->set_params($this->categoryListParams); - $this->listCategory->initialise(); - - /* get categories id */ - $categoryIDs = array_keys($this->listCategory->objectList); - $cnts = $this->contactItem->count_byCategories($categoryIDs); - foreach( $this->listCategory->objectList as $id => $category) - $this->listCategory->objectList[$id]->vars['contacts'] = isset($cnts[$id])?$cnts[$id]:0; - } - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - /* add contacts tab */ - $this->tabBuilder->add_tab(array('name'=>'contacts', - 'title'=>$this->get_translation('tabcontacts'))); - /* add categories tab */ - if ( $this->check_right(1) === true ) - $this->tabBuilder->add_tab(array('name'=>'categories', - 'title'=>$this->get_translation('tabcategories'))); - /* add help tab */ - if ( $this->help != null ) - $this->tabBuilder(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'contacts')); - - /* get buttons */ - $this->buttons = array(array('link'=>$camyks->get_adminLink(), - 'title'=>$camyks->get_translation('back'))); - } - - /* - * init module object in admin/edit_contact mode - * @return void - * @access private - */ - function init_admin_edit_contact() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - $this->lgs = $camyks->get_confValue('editing_languages'); - - /* get contact item */ - $contact_id = isset($_REQUEST['contact_id'])?$_REQUEST['contact_id']:0; - $this->contactItem->id = $contact_id; - $this->contactItem->get(); - $this->contactItem->get_fromItems(); - - /* get data */ - $this->categoryList = $this->get_categoryTitleList(); - - /* get form */ - $this->editform = new HTMLForm('edit_contact', - $camyks->get_adminlink( $this->name, array('mode'=>'save_contact')), - 'POST'); - $this->editform->add_hidden('contact_id', $this->contactItem->id ); - $this->editform->set_object($this->contactItem); - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - /* add contacts tab */ - $this->tabBuilder->add_tab(array('name'=>'properties', - 'title'=>$this->get_translation('tabproperties'))); - if ( count( $this->lgs ) == 1) - $this->tabBuilder->add_tab(array('name'=>$this->lgs[0], - 'title'=>$this->get_translation('tabcontent'))); - else - foreach ( $this->lgs as $l ) - $this->tabBuilder->add_tab(array('name'=>$l, - 'title'=>language_getIcon($l))); - /* add help tab */ - if ( $this->help != null ) - $this->tabBuilder->add_tab(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'contacts')); - - /* load editor */ - $this->editor = &$camyks->inputs['TinyMCEv3']; - $this->editor->initialise(); - - /* initialise page chooser */ - $this->add_JSFile('glossarymanager.js'); - $link = $camyks->get_confValue('url').'/request.php?module=Admin_ContentPage'; - $this->add_JSScript('pc2 = new PageChooser("pagename", "glossarymanager_updateButtonLink", "'.$link.'");'); - - /* build title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - if ($this->contactItem->id == 0 ) - $this->adminTitle .= $this->get_translation('contactnew'); - else - $this->adminTitle .= $this->get_translation('contactid', $this->contactItem->id); - - /* build button list */ - $this->buttons = array(array('link'=>$this->get_adminLink(), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->editform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - - /* update layout */ - $this->selected_layout = 'admin_edit_contact.html.inc'; - } - - /* - * init module object in admin/save_contact mode - * @return void - * @access private - */ - function init_admin_save_contact() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check contact id */ - if ( !isset($_REQUEST['contact_id'])) - return $this->init_admin_main(); - $contact_id = $_REQUEST['contact_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save contact */ - $this->contactItem->id = $contact_id; - $this->contactItem->get_fromHeader(); - if ( $this->contactItem->save() ) - $this->text = $this->get_translation('contact_saved'); - else - $this->text = $this->get_translation('contact_notsaved'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink()); - } - - /* - * init module object in admin/delete_contact mode - * @return void - * @access private - */ - function init_admin_delete_contact() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed () ; - - /* check contact id */ - if ( !isset($_REQUEST['contact_id'])) - return $this->init_admin_main(); - $contact_id = $_REQUEST['contact_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* delete contact */ - $this->contactItem->id = $contact_id; - if ( $this->contactItem->delete()) - $this->text = $this->get_translation('contact_deleted'); - else - $this->text = $this->get_translation('contact_notdeleted'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink()); - } - - /* - * init module object in admin/edit_category mode - * @return void - * @access private - */ - function init_admin_edit_category() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed () ; - - /* get category item */ - $category_id = isset($_REQUEST['category_id'])?$_REQUEST['category_id']:0; - $this->categoryItem->id = $category_id; - $this->categoryItem->get(); - $this->categoryItem->get_fromItems(); - - /* get form */ - $this->editform = new HTMLForm('edit_category', - $this->get_adminlink(array('mode'=>'save_category')), - 'POST'); - $this->editform->set_object($this->categoryItem); - $this->editform->add_hidden('category_id', $this->categoryItem->id ); - - /* build button list */ - $this->buttons = array(array('link'=>$this->get_adminLink(array('openTab'=>'categories')), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->editform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - - /* set interface title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - if ($this->categoryItem->id == 0 ) - $this->adminTitle .= $this->get_translation('newcategory'); - else - $this->adminTitle .= $this->get_translation('categoryid', $this->categoryItem->id); - - /* update layout */ - $this->selected_layout = 'admin_edit_category.html.inc'; - } - - /* - * init module object in admin/save_category mode - * @return void - * @access private - */ - function init_admin_save_category() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check category id */ - if(!isset($_REQUEST['category_id'])) - return $this->init_admin_main(); - $category_id = $_REQUEST['category_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save category */ - $this->categoryItem->id = $category_id; - $this->categoryItem->get_fromHeader(); - if ( $this->categoryItem->save() ) - $this->text = $this->get_translation('category_saved'); - else - $this->text = $this->get_translation('category_notsaved'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink(array('openTab'=>'categories'))); - } - - /* - * init module object in admin/delete_category mode - * @return void - * @access private - */ - function init_admin_delete_category() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check category id */ - if(!isset($_REQUEST['category_id'])) - return $this->init_admin_main(); - $category_id = $_REQUEST['category_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* delete category */ - $this->categoryItem->id = $category_id; - if ( $this->categoryItem->delete()) - $this->text = $this->get_translation('category_deleted'); - else - $this->text = $this->get_translation('category_notdeleted'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink(array('openTab'=>'categories'))); - } - - /* specific admin tool methods */ - - /* - * return category status list - * @return array - * @access public - */ - function get_categoryStatusList() { - return $this->categoryItem->get_statusList(); - } - - /* - * return categories status list - * @param boolean $full - * @return array - * @access public - */ - function get_categoriesStatusList($full=false) { - return $this->categoryItem->get_multiStatusList($full); - } - - /* - * return category title list - * @param boolean $full - * @param array $params - * @return array - * @access public - */ - function get_categoryTitleList($full=false, $params=array()) { - if (!isset($params['language'])) - $params['language'] = $this->get_adminEditionLanguage(); - - $list = $this->categoryItem->get_titleList($params); - if ($full) - $list = array(0=>$this->get_translation('categorytitle_all'))+ $list; - return $list; - } - - /* - * return contact status list - * @return array - * @access public - */ - function get_contactStatusList() { - return $this->contactItem->get_statusList(); - } - - /* - * return contacts status list - * @param boolean $full - * @return array - * @access public - */ - function get_contactsStatusList($full=false) { - return $this->contactItem->get_multiStatusList($full); - } - - /* - * return contact list - * @param array $params - * @return array - * @access public - */ - function get_contactList($params=array()) { - return $this->contactItem->get_list($params); - } - - /* - * return contact count - * @param array $params - * @return array - * @access public - */ - function count_contacts($params=array()) { - return $this->contactItem->count($params); - } -} -?> \ No newline at end of file + Manages a directory of contacts, by category. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericDirectoryManager class. + */ +final class Admin_GenericDirectoryManager extends Module { + /** + * var Object $contactItem + * @brief Contact object. + */ + public $contactItem; + + /** + * var array $contactList + * @brief Contact list. + */ + public $contactList = null; + + /** + * var Object $categoryItem + * @brief Category object. + */ + public $categoryItem; + + /** + * var array $categoryList + * @brief Category list. + */ + public $categoryList = null; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_GenericDirectoryManager', $path_type); + + /* Override Plugin variables */ + $this->plugin_package = 'Generic'; + $this->version = '1.0'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'content'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load plugin libraries */ + $this->load_library('Admin_GenericDirectoryManagerContact'); + $this->load_library('Admin_GenericDirectoryManagerCategory'); + + /* Initialise plugin libraries */ + $this->contactItem = new Admin_GenericDirectoryManagerContact(0, $this); + $this->categoryItem = new Admin_GenericDirectoryManagerCategory(0, $this); + } + + /* Override Module methods */ + + /** + * Install module. + * @return boolean success + */ + public function install() { + return ($this->contactItem->install() and $this->categoryItem->install() + and parent::install()); + } + + /** + * Check module installation. + * @return boolean result + */ + public function is_installed() { + return $this->contactItem->is_installed(); + } + + /** + * Define module permissions. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => true, + ); + $this->rights[1] = array( + 'name' => 'category', + 'title' => $this->get_translation('rights_category'), + 'default' => false, + ); + $this->rights[2] = array( + 'name' => 'contact', + 'title' => $this->get_translation('rights_contact'), + 'default' => false, + ); + } + + /** + * Initialise module object in admin mode. + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Check dependencies */ + if (!isset($camyks->inputs['TabBuilder'])) + return $this->init_admin_missingPlugin('Input', 'TabBuilder'); + if (!isset($camyks->inputs['AdminItemListViewer'])) + return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); + if (!isset($camyks->inputs['TinyMCEv3'])) + return $this->init_admin_missingPlugin('Input', 'TinyMCEv3'); + + /* Load action to execute */ + $this->mode = (isset ($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'); + + /* Execute action */ + switch ($this->mode) { + case 'edit_category': + /* mode == edit_category */ + $this->init_admin_edit_category(); + break; + case 'save_category': + /* mode == save_category */ + $this->init_admin_save_category(); + break; + case 'delete_category': + /* mode == delete_category */ + $this->init_admin_delete_category(); + break; + case 'edit_contact': + /* mode == edit_contact */ + $this->init_admin_edit_contact(); + break; + case 'save_contact': + /* mode == save_contact */ + $this->init_admin_save_contact(); + break; + case 'delete_contact': + /* mode == delete_contact */ + $this->init_admin_delete_contact(); + break; + case 'main': + default: + /* mode == main */ + $this->init_admin_main(); + } + + /* Perform generic initialisation */ + parent::init_admin(); + } + + /* Specific admin mode methods */ + + /** + * Initialise module object in admin/main mode. + * @return void + */ + private function init_admin_main() { + global $camyks; + + /* Load help */ + $this->get_help(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + + /* Build contact tab */ + $this->load_library('Admin_GenericDirectoryManagerContactListParams'); + $this->listContact = new AdminItemListViewer('camyks'); + $this->listContact->set_params($this->contactListParams); + $this->listContact->initialise(); + + /* build category tab */ + if ($this->check_right(1) === true) { + $this->load_library('Admin_GenericDirectoryManagerCategoryListParams'); + $this->listCategory = new AdminItemListViewer('camyks'); + $this->listCategory->set_params($this->categoryListParams); + $this->listCategory->initialise(); + + /* Load categories id */ + $categoryIDs = array_keys($this->listCategory->objectList); + $cnts = $this->contactItem->count_byCategories($categoryIDs); + foreach($this->listCategory->objectList as $id => $category) + $this->listCategory->objectList[$id]->vars['contacts'] = isset($cnts[$id]) ? $cnts[$id] : 0; + } + + /* Load tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + + /* Add contacts tab */ + $this->tabBuilder->add_tab(array( + 'name' => 'contacts', + 'title' => $this->get_translation('tabcontacts'), + )); + + /* Add categories tab */ + if ($this->check_right(1)) + $this->tabBuilder->add_tab(array( + 'name' => 'categories', + 'title' => $this->get_translation('tabcategories'), + )); + + /* Add help tab */ + if ($this->help != null) + $this->tabBuilder(array( + 'name' => 'help', + 'title' => $camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'contacts')); + + /* Load interface buttons */ + $this->buttons = array( + array( + 'link' => $camyks->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + ); + } + + /** + * Initialise module object in admin/edit_contact mode. + * @return void + */ + private function init_admin_edit_contact() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + $this->lgs = $camyks->get_confValue('editing_languages'); + + /* Load contact item */ + $this->contactItem->id = isset($_REQUEST['contact_id']) ? (int)$_REQUEST['contact_id'] : 0; + $this->contactItem->get(); + $this->contactItem->get_fromItems(); + + /* Load data */ + $this->categoryList = $this->get_categoryTitleList(); + + /* Build form */ + $this->editform = new HTMLForm('edit_contact', $this->get_adminlink(array('mode'=>'save_contact')), 'POST'); + $this->editform->add_hidden('contact_id', $this->contactItem->id); + $this->editform->set_object($this->contactItem); + + /* Load tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + + /* Add properties tab */ + $this->tabBuilder->add_tab(array( + 'name' => 'properties', + 'title' => $camyks->get_translation('properties'), + )); + if (count($this->lgs) == 1) + $this->tabBuilder->add_tab(array( + 'name' => $this->lgs[0], + 'title' => $this->get_translation('tabcontent'), + )); + else + foreach ($this->lgs as $l) + $this->tabBuilder->add_tab(array( + 'name' => $l, + 'title' => language_getIcon($l), + )) + ; + /* Add help tab */ + if ($this->help != null) + $this->tabBuilder->add_tab(array( + 'name' => 'help', + 'title' => $camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'contacts')); + + /* Load editor */ + $this->editor = &$camyks->inputs['TinyMCEv3']; + $this->editor->initialise(); + + /* Initialise page chooser */ + $this->add_JSFile('glossarymanager.js'); + $link = $camyks->get_confValue('url').'/request.php?module=Admin_ContentPage'; + $this->add_JSScript('pc2 = new PageChooser("pagename", "glossarymanager_updateButtonLink", "'.$link.'");'); + + /* Build title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + if ($this->contactItem->id == 0) + $this->adminTitle .= $this->get_translation('contactnew'); + else + $this->adminTitle .= $this->get_translation('contactid', $this->contactItem->id); + + /* Build interface buttons */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_contact.html.inc'); + } + + /** + * Initialise module object in admin/save_contact mode. + * @return void + */ + private function init_admin_save_contact() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check contact id */ + if (!isset($_REQUEST['contact_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save contact */ + $this->contactItem->id = (int)$_REQUEST['contact_id']; + $this->contactItem->get_fromHeader(); + if ($this->contactItem->save()) + $this->text = $this->get_translation('contact_saved'); + else + $this->text = $this->get_translation('contact_notsaved'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/delete_contact mode. + * @return void + */ + private function init_admin_delete_contact() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check contact id */ + if (!isset($_REQUEST['contact_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Delete contact */ + $this->contactItem->id = (int)$_REQUEST['contact_id']; + if ($this->contactItem->delete()) + $this->text = $this->get_translation('contact_deleted'); + else + $this->text = $this->get_translation('contact_notdeleted'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/edit_category mode. + * @return void + */ + private function init_admin_edit_category() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load category item */ + $category_id = + $this->categoryItem->id = isset($_REQUEST['category_id']) ? (int)$_REQUEST['category_id'] : 0; + $this->categoryItem->get(); + $this->categoryItem->get_fromItems(); + + /* Build form */ + $this->editform = new HTMLForm('edit_category', $this->get_adminlink(array('mode'=>'save_category')), 'POST'); + $this->editform->set_object($this->categoryItem); + $this->editform->add_hidden('category_id', $this->categoryItem->id); + + /* Build button list */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(array('openTab'=>'categories')), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ), + ); + + /* Build interface title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + if ($this->categoryItem->id == 0) + $this->adminTitle .= $this->get_translation('newcategory'); + else + $this->adminTitle .= $this->get_translation('categoryid', $this->categoryItem->id); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_category.html.inc'); + } + + /** + * Initialise module object in admin/save_category mode. + * @return void + */ + private function init_admin_save_category() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check category id */ + if (!isset($_REQUEST['category_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save category */ + $this->categoryItem->id = (int)$_REQUEST['category_id']; + $this->categoryItem->get_fromHeader(); + if ($this->categoryItem->save()) + $this->text = $this->get_translation('category_saved'); + else + $this->text = $this->get_translation('category_notsaved'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/delete_category mode. + * @return void + */ + private function init_admin_delete_category() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check category id */ + if(!isset($_REQUEST['category_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Delete category */ + $this->categoryItem->id = (int)$_REQUEST['category_id']; + if ($this->categoryItem->delete()) + $this->text = $this->get_translation('category_deleted'); + else + $this->text = $this->get_translation('category_notdeleted'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /* Specific admin tool methods */ + + /** + * Return category status list. + * @return array + */ + public function get_categoryStatusList() { + return $this->categoryItem->get_statusList(); + } + + /** + * Return categories status list. + * @param boolean $full + * @return array + */ + public function get_categoriesStatusList($full=false) { + return $this->categoryItem->get_multiStatusList($full); + } + + /** + * Return category title list. + * @param boolean $full + * @param array $params + * @return array + */ + public function get_categoryTitleList($full=false, $params=array()) { + if (!isset($params['language'])) + $params['language'] = $this->get_adminEditionLanguage(); + + $list = $this->categoryItem->get_titleList($params); + if ($full) + $list = array(0=>$this->get_translation('categorytitle_all'))+ $list; + return $list; + } + + /** + * Return contact status list. + * @return array + */ + public function get_contactStatusList() { + return $this->contactItem->get_statusList(); + } + + /** + * Return contacts status list. + * @param boolean $full + * @return array + */ + public function get_contactsStatusList($full=false) { + return $this->contactItem->get_multiStatusList($full); + } + + /** + * Return contact list. + * @param array $params + * @return array + */ + public function get_contactList($params=array()) { + return $this->contactItem->get_list($params); + } + + /** + * Return contact count. + * @param array $params + * @return array + */ + public function count_contacts($params=array()) { + return $this->contactItem->count($params); + } +} +?> diff --git a/plugin/module/Admin_GenericDirectoryManager/html/admin.html.inc b/plugin/module/Admin_GenericDirectoryManager/html/admin.html.inc index 0f829892..509ce456 100755 --- a/plugin/module/Admin_GenericDirectoryManager/html/admin.html.inc +++ b/plugin/module/Admin_GenericDirectoryManager/html/admin.html.inc @@ -1,40 +1,32 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : May 2010 - * Last Modif Date : May 2010 - * - * Admin_GenericGlossaryManager Module Admin Layout : main -*/ -global $camyks; -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->title) ?> -theme->get_boxTabsBar($this->tabBuilder->tabs, - $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header( )?> -
- -listContact->display('head');?> - -listContact->display('list');?> - -
- -check_right(1) === true) : ?> -
- -listCategory->display('head');?> - -listCategory->display('list');?> - -
- -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header(); ?> +
+ listContact->display('head'); ?> + listContact->display('list'); ?> +
+ +check_right(1)) : ?> +
+ listCategory->display('head'); ?> + listCategory->display('list'); ?> +
+ +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_category.html.inc b/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_category.html.inc index 08befeff..383d25dd 100755 --- a/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_category.html.inc +++ b/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_category.html.inc @@ -1,61 +1,59 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : May 2010 - * Last Modif Date : May 2010 - * - * Admin_GenericGlossaryManager Module Admin Layout : edit_category - */ -global $camyks; - -$flags = array(); -$lgs = $camyks->get_confValue('editing_languages'); -if ( count($lgs) == 1) { - $flags[$lgs[0]] = ''; -} else { - foreach ($lgs as $l) - $flags[$l] = ''; -} -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxContent2Header( )?> -editform->display_header(); ?> -editform->display_hiddens(); ?> -
- - - - - - - - - - - - - - - -
-get_translation('formitem_status')?> - -editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_categoryStatusList()));?> -
- -get_translation('formitem_title')?> - -editform->display_textInput(array('name'=>'title', 'language'=>$l));?> -
-
-editform->display_footer(); ?> - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; + +$flags = array(); +$lgs = $camyks->get_confValue('editing_languages'); +if (count($lgs) == 1) { + $flags[$lgs[0]] = ''; +} else { + foreach ($lgs as $l) + $flags[$l] = ''; +} +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxContent2Header(); ?> +editform->display_header(); ?> +editform->display_hiddens(); ?> +
+ + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + + editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_categoryStatusList())); ?> +
+ + get_translation('formitem_title'); ?> + + editform->display_textInput(array('name'=>'title', 'language'=>$l)); ?> +
+
+editform->display_footer(); ?> + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_contact.html.inc b/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_contact.html.inc index d291a6df..5107357f 100755 --- a/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_contact.html.inc +++ b/plugin/module/Admin_GenericDirectoryManager/html/admin_edit_contact.html.inc @@ -1,101 +1,91 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : May 2010 - * Last Modif Date : May 2010 - * - * Admin_GenericGlossaryManager Module Admin Layout : edit_definition -*/ -global $camyks; -$file = $this->theme->get_pictURL('file', 12, 'std'); -$file_ = $this->theme->get_pictURL('file', 12, 'ovr'); -?> -theme->get_boxHeader('width:610px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxTabsBar($this->tabBuilder->tabs, - $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header( )?> -editform->display_header(); ?> -editform->display_hiddens(); ?> -
- - - - - - - - - - - - - - - - - -
-get_translation('formitem_status')?> - -editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_definitionStatusList()));?> -
-get_translation('formitem_category')?> - -editform->display_selectInput(array('name'=>'category', 'values'=>$this->categoryList));?> -
-get_translation('formitem_link')?> - -editform->display_textInput('link');?> -  - -<?=$this->get_translation('select_sitepage');?> - -
-
- -lgs as $l ) : ?> - -
- - - - - - - - - - - - - - -
-get_translation('formitem_word')?> - -editform->display_textInput(array('name'=>'word', 'language'=>$l));?> -
-get_translation('formitem_description')?> -
-editor->set_contentInfos('text', $this->definitionItem->vars['description_'.$l] ); ?> -editor->set_textareaInfos('description_'.$l, '100%', '300px'); ?> -editor->display();?> -
-
- - - -editform->display_footer(); ?> -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; + +$file = $this->theme->get_pictURL('file', 12, 'std'); +$file_ = $this->theme->get_pictURL('file', 12, 'ovr'); +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header(); ?> +editform->display_header(); ?> +editform->display_hiddens(); ?> +
+ + + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + + editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_definitionStatusList())); ?> +
+ get_translation('formitem_category'); ?> + + editform->display_selectInput(array('name'=>'category', 'values'=>$this->categoryList)); ?> +
+ get_translation('formitem_link'); ?> + + editform->display_textInput('link'); ?> +   + + <?= $this->get_translation('select_sitepage'); ?> + +
+
+ +lgs as $l) : ?> +
+ + + + + + + + + + + + + +
+ get_translation('formitem_word'); ?> + + editform->display_textInput(array('name'=>'word', 'language'=>$l)); ?> +
+ get_translation('formitem_description'); ?> +
+ editor->set_contentInfos('text', $this->definitionItem->vars['description_'.$l]); ?> + editor->set_textareaInfos('description_'.$l, '100%', '300px'); ?> + editor->display(); ?> +
+
+ + +editform->display_footer(); ?> +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategory.php.inc b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategory.php.inc index 09f2b972..59ef2fb0 100755 --- a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategory.php.inc +++ b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategory.php.inc @@ -1,126 +1,126 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Jul 2010 - * Last Modif Date : Jul 2010 - * - * Admin_GenericDirectoryManagerCategory object for Admin_GenericDirectoryManager Module - */ - -class Admin_GenericDirectoryManagerCategory extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericDirectoryManagerCategory ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - /* content items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); - - /* temp items */ - $this->add_newItem('contacts', 'temp', 'int', '', '', 0); - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary methods */ - - /* - * build sql condition for lists - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition($params) { - if ( isset( $params['status'] ) and $params['status'] > -1 ) - return 'status='.$params['status']; - return ''; - } - - /* specific methods */ - - /* - * is category deletable - * @return boolean result - * @access public - */ - function is_deletable() { - return (isset($this->vars['contacts']) and $this->vars['contacts'] == 0 ); - } - - /* - * return categories status list - * @param boolean $full - * @return array - * @access public - */ - function get_multiStatusList($full=false) { - $list = array(); - if($full) - $list['-1'] = $this->get_translation('categoriesstatus_all'); - $list['0'] = $this->get_translation('categoriesstatus_disabled'); - $list['1'] = $this->get_translation('categoriesstatus_enabled'); - return $list; - } - - /* - * return single category status list - * @return array - * @access public - */ - function get_statusList() { - return array(0 => $this->get_translation('categorystatus_disabled'), - 1 => $this->get_translation('categorystatus_enabled')); - } - - /* - * return categories title list - * @param array $params - * @param string $lg - * @return array - * @access public - */ - function get_titleList($params=array()) { - global $camyks; - - /* default params */ - $dParams = array('language'=>$camyks->current_language, 'status'=>-1, 'ids'=>-1); - - /* merge params */ - $params = array_merge($dParams, $params); - - /* initialise where statement */ - $w = array(); - - /* check status */ - if ($params['status'] != -1) - $w[] = 'status = '. $params['status']; - - /* check id list */ - if ($params['ids'] != -1) { - if (is_string($params['ids'])) - $params['ids'] = explode(',', $params['ids']); - if ( count($params['ids']) == 0 ) - return array(); - if ( count($params['ids']) == 1 ) - $w[] = 'id = '.$params['ids'][0]; - else - $w[] = 'id in ('.implode(',', $params['ids']).')'; - } - - /* compile where statement */ - $w = implode(' and ', $w); - - /* get load list */ - return $this->get_nameList('title', $w, $params['language']); - } -} -?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Jun 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericDirectoryManagerCategory class. + */ +final class Admin_GenericDirectoryManagerCategory extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Content attributes */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); + + /* Temporary items */ + $this->add_newItem('contacts', 'temp', 'int', '', '', 0); + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary methods */ + + /** + * Build sql condition for lists. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + if (isset($params['status']) and $params['status'] > -1) + return 'status='.$params['status']; + return ''; + } + + /* Specific methods */ + + /** + * Check is category deletable. + * @return boolean result + */ + public function is_deletable() { + return (isset($this->vars['contacts']) and $this->vars['contacts'] == 0); + } + + /** + * Return categories status list. + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if ($full) + $list['-1'] = $this->get_translation('categoriesstatus_all'); + $list['0'] = $this->get_translation('categoriesstatus_disabled'); + $list['1'] = $this->get_translation('categoriesstatus_enabled'); + return $list; + } + + /** + * Return single category status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('categorystatus_disabled'), + 1 => $this->get_translation('categorystatus_enabled'), + ); + } + + /** + * Return categories title list. + * @param array $params + * @return array + */ + public function get_titleList($params=array()) { + global $camyks; + + /* Build default params */ + $dParams = array('language'=>$camyks->current_language, 'status'=>-1, 'ids'=>-1); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Initialise where statement */ + $w = array(); + + /* Check status */ + if ($params['status'] != -1) + $w[] = 'status = '. $params['status']; + + /* Check id list */ + if ($params['ids'] != -1) { + if (is_string($params['ids'])) + $params['ids'] = explode(',', $params['ids']); + if (count($params['ids']) == 0) + return array(); + if (count($params['ids']) == 1) + $w[] = 'id = '.$params['ids'][0]; + else + $w[] = 'id in ('.implode(',', $params['ids']).')'; + } + + /* Compile where statement */ + $w = implode(' and ', $w); + + /* Return list */ + return $this->get_nameList('title', $w, $params['language']); + } +} +?> diff --git a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategoryListParams.php.inc b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategoryListParams.php.inc index 96e72cbe..cf39b049 100755 --- a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategoryListParams.php.inc +++ b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategoryListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Jul 2010 - * Last Modif Date : Jul 2010 - * - * Admin_GenericDirectoryManager category list parameters +/** + * @brief Admin_GenericDirectoryManager Module category list parameters. + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -29,8 +28,10 @@ $this->categoryListParams = array('name'=>'categoryList', 'useSession'=>true, 'o $this->categoryListParams['headhiddens'] = array('openTab'=>'categories'); /* build head parameters */ -$this->categoryListParams['headselectors'] = array('page'=> array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->categoryStatusList, 'default'=>'-1')); +$this->categoryListParams['headselectors'] = array( + 'page' => array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->categoryStatusList, 'default'=>'-1'), +); /* build sort parameters */ $this->categoryListParams['sort'] = array('allowed'=>false, 'default'=>'title', 'defaultway'=>''); @@ -38,9 +39,11 @@ $this->categoryListParams['sort'] = array('allowed'=>false, 'default'=>'title', /* build column parameters */ $this->categoryListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewcategory'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editCategoryLink, 0), 'titlecolumn'=>'title', 'buttoncolumn'=>'edit')); -$this->categoryListParams['listcolumns'] = array('status'=>array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), - 'title'=>array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), - 'contacts'=>array('title'=>$this->get_translation('contacts'), 'columntype'=>'text'), - 'edit'=>array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editCategoryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editcategory')), - 'delete'=>array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteCategoryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletecategory'), 'condition'=>'is_deletable')); -?> \ No newline at end of file +$this->categoryListParams['listcolumns'] = array( + 'status' => array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), + 'title' => array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), + 'contacts' => array('title'=>$this->get_translation('contacts'), 'columntype'=>'text'), + 'edit' => array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editCategoryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editcategory')), + 'delete' => array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteCategoryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletecategory'), 'condition'=>'is_deletable'), +); +?> diff --git a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContact.php.inc b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContact.php.inc index c01e2e72..7c21439a 100755 --- a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContact.php.inc +++ b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContact.php.inc @@ -1,204 +1,209 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Jul 2010 - * Last Modif Date : Jul 2010 - * - * Admin_GenericDirectoryManagerContact object for Admin_GenericDirectoryManager Module - */ - -class Admin_GenericDirectoryManagerContact extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericDirectoryManagerContact ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - /* content items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('category', 'db', 'int', 'int unsigned', '', 0); - $this->add_newItem('title', 'db', 'text', 'varchar', 6, ''); - $this->add_newItem('firstname', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('lastname', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('company', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('phone', 'db', 'text', 'varchar', 24, ''); - $this->add_newItem('mobile', 'db', 'text', 'varchar', 24, ''); - $this->add_newItem('fax', 'db', 'text', 'varchar', 24, ''); - $this->add_newItem('address1', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('address2', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('address3', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('address4', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('zipcode', 'db', 'text', 'varchar', 16, ''); - $this->add_newItem('city', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('state', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('country', 'db', 'text', 'varchar', 4, ''); - - $this->add_newItem('website', 'db', 'text', 'varchar', 255, ''); - $this->add_newItem('email', 'db', 'text', 'varchar', 255, ''); - - $this->add_newItem('description', 'db', 'text', 'text', '', '', true); - - $this->add_newItem('facebook', 'db', 'text', 'varchar', 255, ''); - $this->add_newItem('twitter', 'db', 'text', 'varchar', 255, ''); - $this->add_newItem('linkedin', 'db', 'text', 'varchar', 255, ''); - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary method */ - - /* - * build sql condition for lists - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition($params) { - $search = array(); - if ( isset( $params['status'] ) and $params['status'] > -1 ) - $search[] = 'status='.$params['status']; - if ( isset( $params['category'] ) and $params['category'] > 0 ) - $search[] = 'category='.$params['category']; - return implode(',', $search); - } - - /* specific tool methods */ - - /* - * get document count by categories - * @param array $categories - * @return array - * @access public - */ - function count_byCategories($categories=null) { - global $camyks; - - $list = array(); - /* check categories */ - if ( is_array($categories) and count($categories) == 0) - return $list; - - /* build sql query */ - $sql = 'select category, count(id) as cnt from '.$this->_libSQLTable; - if ( is_array($categories) and count($categories)>0 ) - $sql .= ' where category in ('.implode(',', $categories).')'; - $sql .= ' group by category'; - - /* execute sql query */ - if ( $req = mysql_query($sql) or $camyks->log_sqlerror( $this, $sql, __FILE__, __LINE__ ) ) - /* get data from database */ - while ( $data = mysql_fetch_assoc( $req )) - $list[$data['category']] = $data['cnt']; - /* send results */ - return $list; - } - - /* - * return contacts status list - * @param boolean $full - * @return array - * @access public - */ - function get_multiStatusList($full=false) { - $list = array(); - if($full) - $list['-1'] = $this->get_translation('contactsstatus_all'); - $list['0'] = $this->get_translation('contactsstatus_disabled'); - $list['1'] = $this->get_translation('contactsstatus_enabled'); - return $list; - } - - /* - * return single contact status list - * @return array - * @access public - */ - function get_statusList() { - return array(0 => $this->get_translation('contactstatus_disabled'), - 1 => $this->get_translation('contactstatus_enabled')); - } - - /* - * return contact list with given params - * @params array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - $p = array('letters'=>'', 'category'=>0, 'status'=>-1, 'limit'=>-1, 'count'=>-1, 'categories'=>''); - $params = array_merge($p, $params); - $w = $this->build_whereStatement($params); - return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], 'word', 'asc'); - } - - /* - * return contact count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('letters'=>'', 'category'=>0, 'status'=>-1, 'categories'=>''); - $params = array_merge($p, $params); - return $this->get_objectCount($this->build_whereStatement($params)); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - /* check status */ - if ( $params['status'] != -1 ) - $w[] = 'status = '.$params['status']; - - /* check letters */ - if ($params['letters'] != '') { - if (strlen($params['letters']) == 1) - $w[] = 'word like "'.$params['letters'].'%"'; - else - $w[] = 'word REGEXP "^['.$params['letters'].'].*$"'; - } - - /* check category */ - if ($params['category'] > 0) - $w[] = 'category = '.$params['category']; - - /* check categories */ - if ($params['categories'] != '') { - if (is_string($params['categories'])) - $params['categories'] = explode(',', $params['categories']); - if (count($params['categories']) == 0) - return '0=1'; - if (count($params['categories']) == 1) - $w[] = 'category = '.$params['categories'][0]; - else - $w[] = 'category in ('.implode(',',$params['categories']).')'; - } - return implode(' and ', $w); - } - - /* - * return contact name name display for admin list - * @return string - * @access private - */ - function get_nameListDisplay() { - if ($this->vars['company'] == '') - return $this->vars['firstname'].' '.$this->vars['lastname']; - return $this->vars['company']; - } -} -?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Jun 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericDirectoryManagerContact class. + */ +final class Admin_GenericDirectoryManagerContact extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Content attributes */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('category', 'db', 'int', 'int unsigned', '', 0); + $this->add_newItem('title', 'db', 'text', 'varchar', 6, ''); + $this->add_newItem('firstname', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('lastname', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('company', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('phone', 'db', 'text', 'varchar', 24, ''); + $this->add_newItem('mobile', 'db', 'text', 'varchar', 24, ''); + $this->add_newItem('fax', 'db', 'text', 'varchar', 24, ''); + $this->add_newItem('address1', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('address2', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('address3', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('address4', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('zipcode', 'db', 'text', 'varchar', 16, ''); + $this->add_newItem('city', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('state', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('country', 'db', 'text', 'varchar', 4, ''); + + $this->add_newItem('website', 'db', 'text', 'varchar', 255, ''); + $this->add_newItem('email', 'db', 'text', 'varchar', 255, ''); + + $this->add_newItem('description', 'db', 'text', 'text', '', '', true); + + $this->add_newItem('facebook', 'db', 'text', 'varchar', 255, ''); + $this->add_newItem('twitter', 'db', 'text', 'varchar', 255, ''); + $this->add_newItem('linkedin', 'db', 'text', 'varchar', 255, ''); + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary method */ + + /** + * Build sql condition for lists. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + $search = array(); + if (isset($params['status']) and $params['status'] > -1) + $search[] = 'status='.$params['status']; + if (isset($params['category']) and $params['category'] > 0) + $search[] = 'category='.$params['category']; + return implode(',', $search); + } + + /* Specific tool methods */ + + /** + * Return document count by categories. + * @param array $categories + * @return array + */ + public function count_byCategories($categories=null) { + global $camyks; + + /* Initialise result */ + $list = array(); + + /* Check categories */ + if (is_array($categories) and count($categories) == 0) + return $list; + + /* Build SQL query */ + $sql = 'select category, count(id) as cnt from '.$this->_libSQLTable; + if (is_array($categories) and count($categories)>0) + $sql .= ' where category in ('.implode(',', $categories).')'; + $sql .= ' group by category'; + + /* Execute SQL query */ + if ($this->execute_DBQuery($sql, __LINE__)) + if ($data = $this->get_DBQueryDataLine()) + $list[$data['category']] = $data['cnt']; + + /* Send results */ + return $list; + } + + /** + * Return contacts status list. + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if ($full) + $list['-1'] = $this->get_translation('contactsstatus_all'); + $list['0'] = $this->get_translation('contactsstatus_disabled'); + $list['1'] = $this->get_translation('contactsstatus_enabled'); + return $list; + } + + /** + * Return single contact status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('contactstatus_disabled'), + 1 => $this->get_translation('contactstatus_enabled'), + ); + } + + /** + * Return contact list with given params. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + + /* Build default params */ + $dParams = array('category'=>0, 'status'=>-1, 'limit'=>-1, 'count'=>-1, 'categories'=>''); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Build where statement */ + $where = $this->build_whereStatement($params); + + /* Return list */ + return $this->get_objectList($camyks->current_language, $where, $params['limit'], $params['count'], array('lastname'=>'asc', 'firstname'=>'asc'), ''); + } + + /** + * Return contact count with given params. + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + + /* Build default params */ + $dParams = array('category'=>0, 'status'=>-1, 'categories'=>''); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Return count */ + return $this->get_objectCount($this->build_whereStatement($params)); + } + + /** + * Build where statement from params + * @param array $params + * @return string + */ + private function build_whereStatement($params=array()) { + $w = array(); + + /* Check status */ + if ($params['status'] != -1) + $w[] = 'status = '.$params['status']; + + /* Check category */ + if ($params['category'] > 0) + $w[] = 'category = '.$params['category']; + + /* Check categories */ + if ($params['categories'] != '') { + if (is_string($params['categories'])) + $params['categories'] = explode(',', $params['categories']); + if (count($params['categories']) == 0) + return 'false'; + if (count($params['categories']) == 1) + $w[] = 'category = '.$params['categories'][0]; + else + $w[] = 'category in ('.implode(',',$params['categories']).')'; + } + return implode(' and ', $w); + } + + /** + * Return contact name name display for admin list. + * @return string + */ + public function get_nameListDisplay() { + return $this->vars['firstname'].' '.$this->vars['lastname']; + } +} +?> diff --git a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContactListParams.php.inc b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContactListParams.php.inc index dc4638d6..d005f847 100755 --- a/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContactListParams.php.inc +++ b/plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContactListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Jul 2010 - * Last Modif Date : Jul 2010 - * - * Admin_GenericDirectoryManager contact list parameters +/** + * @brief Admin_GenericDirectoryManager Module contact list parameters. + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -26,22 +25,26 @@ $this->add_JSScript('var deleteContactUrl="'.$this->get_adminJSLink(array('mode' $this->contactListParams = array('name'=>'contactList', 'useSession'=>true, 'object'=>&$this->contactItem, 'language'=>$this->language); /* build head parameters */ -$this->contactListParams['headselectors'] = array('page'=> array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->contactStatusList, 'default'=>'-1'), - 'category'=> array('title'=>$this->get_translation('formitem_category'), 'itemtype'=>'select', 'values'=>$this->categoryList, 'default'=>'-1')); +$this->contactListParams['headselectors'] = array( + 'page' => array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->contactStatusList, 'default'=>'-1'), + 'category' => array('title'=>$this->get_translation('formitem_category'), 'itemtype'=>'select', 'values'=>$this->categoryList, 'default'=>'-1'), +); /* build sort parameters */ $this->contactListParams['sort'] = array('allowed'=>false, 'default'=>'word', 'defaultway'=>''); /* build column parameters */ -$this->contactListParams['listcolumns'] = array('status'=>array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), - 'name'=>array('title'=>$camyks->get_translation('name'),'columntype'=>'method', 'method'=>'get_listNameDisplay'), - 'category'=>array('title'=>$this->get_translation('header_category'),'columntype'=>'list', 'values'=>$this->categoryList)); +$this->contactListParams['listcolumns'] = array( + 'status' => array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), + 'name' => array('title'=>$camyks->get_translation('name'),'columntype'=>'method', 'method'=>'get_listNameDisplay'), + 'category' => array('title'=>$this->get_translation('header_category'),'columntype'=>'list', 'values'=>$this->categoryList), +); -if ($this->check_right(2)==true ) { - if (count($this->categoryList)>1) - $this->contactListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewcontact'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editContactLink, 0), 'titlecolumn'=>'name', 'buttoncolumn'=>'edit')); - $this->contactListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editContactLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editcontact')); - $this->contactListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteContactLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletecontact')); - } -?> \ No newline at end of file +if ($this->check_right(2)) { + if (count($this->categoryList) > 1) + $this->contactListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewcontact'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editContactLink, 0), 'titlecolumn'=>'name', 'buttoncolumn'=>'edit')); + $this->contactListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editContactLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editcontact')); + $this->contactListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteContactLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletecontact')); +} +?> diff --git a/plugin/module/Admin_GenericDirectoryManager/locale/translation_fr.php.inc b/plugin/module/Admin_GenericDirectoryManager/locale/translation_fr.php.inc index 0c59297b..c8392453 100755 --- a/plugin/module/Admin_GenericDirectoryManager/locale/translation_fr.php.inc +++ b/plugin/module/Admin_GenericDirectoryManager/locale/translation_fr.php.inc @@ -1,16 +1,15 @@ - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Jul 2010 - * Last Modif Date : Jul 2010 - * - * Admin_GenericDirectoryManager french dictionnary -*/ +/** + * @brief Admin_GenericDirectoryManager Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_genericdirectorymanager_title'] = 'Annuaire'; $this->trads['mod_admin_genericdirectorymanager_desc'] = 'Gestion des contacts'; diff --git a/plugin/module/Admin_GenericFAQManager/Admin_GenericFAQManager.php.inc b/plugin/module/Admin_GenericFAQManager/Admin_GenericFAQManager.php.inc index 8f1878b9..618444c4 100755 --- a/plugin/module/Admin_GenericFAQManager/Admin_GenericFAQManager.php.inc +++ b/plugin/module/Admin_GenericFAQManager/Admin_GenericFAQManager.php.inc @@ -3,10 +3,10 @@ * @brief Admin_GenericFAQManager Module. * @details Plugin / Module engine * @author CaMykS Team - * @version 1.0.0 + * @version 1.0.1 * @date Creation: Feb 2020 - * @date Modification: Feb 2020 - * @copyright 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -274,8 +274,8 @@ final class Admin_GenericFAQManager extends Module { /* get form */ $this->editform = new HTMLForm('edit_question', $this->get_adminlink(array('mode'=>'save_question')), 'POST'); - $this->editform->add_hidden('question_id', $this->questionItem->id); $this->editform->set_object($this->questionItem); + $this->editform->add_hidden('question_id', $this->questionItem->id); /* get editor input */ $this->input = $camyks->get_input('TinyMCEv3'); @@ -446,8 +446,9 @@ final class Admin_GenericFAQManager extends Module { /* Load form */ $this->editform = new HTMLForm('edit_family', $this->get_adminlink(array('mode'=>'save_family')), 'POST'); - $this->editform->add_hidden('family_id', $this->familyItem->id); $this->editform->set_object($this->familyItem); + $this->editform->add_hidden('family_id', $this->familyItem->id); + $this->editform->add_hidden('sortPosition'); /* Build title */ $this->adminTitle = $this->title; diff --git a/plugin/module/Admin_GenericFAQManager/html/admin_edit_family.html.inc b/plugin/module/Admin_GenericFAQManager/html/admin_edit_family.html.inc index 21f8535f..79bd94d8 100755 --- a/plugin/module/Admin_GenericFAQManager/html/admin_edit_family.html.inc +++ b/plugin/module/Admin_GenericFAQManager/html/admin_edit_family.html.inc @@ -3,21 +3,21 @@ * @brief Admin_GenericFAQManager Module admin edit family layout. * @details Plugin / Module layout * @author CaMykS Team - * @version 1.0.0 + * @version 1.0.1 * @date Creation: Feb 2020 - * @date Modification: Feb 2020 - * @copyright 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; $flags = array(); -if (count($camyks->get_confValue('editing_languages')) > 1) - foreach ($camyks->get_confValue('editing_languages') as $l) - $flags[$l] = ''; +if (count($lgs = $camyks->get_confValue('editing_languages')) > 1) + foreach ($lgs as $l) + $flags[$l] = ''; else - foreach ($camyks->get_confValue('editing_languages') as $l) + foreach ($lgs as $l) $flags[$l] = ''; ?> theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> @@ -37,7 +37,7 @@ else - get_confValue('editing_languages') as $l) : ?> + diff --git a/plugin/module/Admin_GenericFAQManager/html/admin_edit_question.html.inc b/plugin/module/Admin_GenericFAQManager/html/admin_edit_question.html.inc index a3244f60..edec25d5 100755 --- a/plugin/module/Admin_GenericFAQManager/html/admin_edit_question.html.inc +++ b/plugin/module/Admin_GenericFAQManager/html/admin_edit_question.html.inc @@ -3,21 +3,21 @@ * @brief Admin_GenericFAQManager Module admin edit question layout. * @details Plugin / Module layout * @author CaMykS Team - * @version 1.0.0 + * @version 1.0.1 * @date Creation: Feb 2020 - * @date Modification: Feb 2020 - * @copyright 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; $flags = array(); -if (count($camyks->get_confValue('editing_languages')) > 1) - foreach ($camyks->get_confValue('editing_languages') as $l) +if (count($lgs = $camyks->get_confValue('editing_languages')) > 1) + foreach ($lgs as $l) $flags[$l] = ''; else - foreach ($camyks->get_confValue('editing_languages') as $l) + foreach ($lgs as $l) $flags[$l] = ''; ?> theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> @@ -46,21 +46,21 @@ else - get_confValue('editing_languages') as $l) : ?> + get_translation('formitem_title'); ?> - editform->display_textInput(array('name'=>'title', 'language'=>$l)); ?> + editform->display_textInput(array('name'=>'title', 'language'=>$l, 'class'=>'linputs')); ?>
-get_confValue('editing_languages') as $l) : ?> +
input->set_contentInfos('text', $this->questionItem->vars['answer_'.$l]); ?> input->set_textareaInfos('answer_'.$l, '100%', '400px'); ?> diff --git a/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerFamily.php.inc b/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerFamily.php.inc index 33db192c..f86c89ed 100755 --- a/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerFamily.php.inc +++ b/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerFamily.php.inc @@ -3,9 +3,9 @@ * @brief Admin_GenericFAQManager Module family library. * @details Plugin / Module layout * @author CaMykS Team - * @version 1.0.0 + * @version 1.0.1 * @date Creation: Feb 2020 - * @date Modification: Feb 2020 + * @date Modification: Jan 2021 * @copyright 2020 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -43,9 +43,18 @@ final class Admin_GenericFAQManagerFamily extends ModuleLibrary { * @return boolean success */ public function check_data() { - /* Add next position to new object */ - if ($this->id == 0) + /* Check sortPosition value */ + if ($this->id == 0) { $this->_libItems['sortPosition']->value = $this->get_newPosition(); + } else { + $o = $this->get_newObject($this->id); + $o->get(); + $o->get_fromItems(); + if ($o->vars['family'] == $this->_libItems['family']->value) + $this->_libItems['sortPosition']->value = $o->vars['sortPosition']; + else + $this->_libItems['sortPosition']->value = $this->get_newPosition(); + } /* Return success */ return true; diff --git a/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerQuestion.php.inc b/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerQuestion.php.inc index f27a0589..c97276ae 100755 --- a/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerQuestion.php.inc +++ b/plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerQuestion.php.inc @@ -3,10 +3,10 @@ * @brief Admin_GenericFAQManager Module question library. * @details Plugin / Module layout * @author CaMykS Team - * @version 1.0.0 + * @version 1.0.1 * @date Creation: Feb 2020 - * @date Modification: Feb 2020 - * @copyright 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2020 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -45,9 +45,18 @@ final class Admin_GenericFAQManagerQuestion extends ModuleLibrary { * @return boolean success */ public function check_data() { - /* Add next position to new object */ - if ($this->id == 0) + /* Check sortPosition value */ + if ($this->id == 0) { $this->_libItems['sortPosition']->value = $this->get_newPosition(); + } else { + $o = $this->get_newObject($this->id); + $o->get(); + $o->get_fromItems(); + if ($o->vars['family'] == $this->_libItems['family']->value) + $this->_libItems['sortPosition']->value = $o->vars['sortPosition']; + else + $this->_libItems['sortPosition']->value = $this->get_newPosition(); + } /* Return success */ return true; @@ -125,11 +134,11 @@ final class Admin_GenericFAQManagerQuestion extends ModuleLibrary { /* check status */ if ($params['status'] != -1) - $w[] = 'status = '.$params['status']; + $w[] = 'status = '.$params['status']; /* check family */ if ($params['family'] != -1) - $w[] = 'family = '.$params['family']; + $w[] = 'family = '.$params['family']; /* return result */ return implode(' and ', $w); diff --git a/plugin/module/Admin_GenericGuestBookManager/Admin_GenericGuestBookManager.php.inc b/plugin/module/Admin_GenericGuestBookManager/Admin_GenericGuestBookManager.php.inc index 3b5b99ea..0c4c89fb 100755 --- a/plugin/module/Admin_GenericGuestBookManager/Admin_GenericGuestBookManager.php.inc +++ b/plugin/module/Admin_GenericGuestBookManager/Admin_GenericGuestBookManager.php.inc @@ -3,10 +3,10 @@ * @brief Admin_GenericGuestBookManager module * @details Plugin / Module Engine * @author CaMykS Team - * @version 1.0.1 + * @version 1.0.1.1 * @date Creation: Sep 2010 - * @date Modification: Feb 2020 - * @copyright 2010 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -16,11 +16,22 @@ */ final class Admin_GenericGuestBookManager extends Module { /** - * Internal variable + * @var Object $msgItem + * @brief Message object. */ public $msgItem; + + /** + * @var array $msgList + * @brief Message list. + */ public $msgList; - public $config; + + /** + * var Object $config + * @brief Plugin configuration. + */ + protected $config; /** * Class constructor. @@ -59,7 +70,7 @@ final class Admin_GenericGuestBookManager extends Module { /* Override Module methods */ /** - * Install module + * Install module. * @return boolean success */ public function install() { @@ -67,7 +78,7 @@ final class Admin_GenericGuestBookManager extends Module { } /** - * unintall module + * Uninstall module. * @return boolean success */ public function uninstall() { @@ -75,7 +86,7 @@ final class Admin_GenericGuestBookManager extends Module { } /** - * check module installation + * Check module installation. * @return boolean result */ public function is_installed() { @@ -83,7 +94,7 @@ final class Admin_GenericGuestBookManager extends Module { } /** - * get module rights + * Define module permission. * @return void */ public function get_rights() { @@ -106,16 +117,16 @@ final class Admin_GenericGuestBookManager extends Module { } /** - * update control panel description + * Update control panel description. * @return void */ public function get_adminControlPanelAction( ) { global $camyks; - /* count messages by status */ + /* Count messages by status */ $n = $this->msgItem->get_objectCount('status=2'); - /* update module description for admin control panel */ + /* Update module description for admin control panel */ if ($n == 1) $camyks->trads['mod_admin_genericguestbookmanager_desc'] = $this->get_translation('desc1'); elseif ($n > 1) @@ -123,17 +134,17 @@ final class Admin_GenericGuestBookManager extends Module { } /** - * Return notified items for module + * Return notified items for module. * @return Array */ public function get_adminInternalNotifications() { - /* load reports count */ + /* Load reports count */ $cnt = $this->msgItem->get_objectCount('status=2'); if ($cnt == 0) return array(); - /* initialise result */ + /* Initialise result */ $result = array($this->name => array( 'title' => $this->title, 'items' => array( @@ -145,7 +156,7 @@ final class Admin_GenericGuestBookManager extends Module { ) )); - /* send result */ + /* Send result */ return $result; } @@ -156,23 +167,23 @@ final class Admin_GenericGuestBookManager extends Module { public function init_admin() { global $camyks; - /* check read rights */ + /* Check read permission */ if ($this->check_right(0) === false) return $this->init_admin_accessDenied(); - /* check dependencies */ + /* Check dependencies */ if (!isset($camyks->inputs['AdminItemListViewer'])) return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); if (!isset($camyks->inputs['TabBuilder'])) return $this->init_admin_missingPlugin('Input', 'TabBuilder'); - /* get informations */ - $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'; - - /* load config */ + /* Load configuration */ $this->config->get(); - /* check action to execute */ + /* Load action to execute */ + $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'; + + /* Execute action */ switch ($this->mode) { case 'view_msg': /* mode == view_msg */ @@ -208,7 +219,7 @@ final class Admin_GenericGuestBookManager extends Module { parent::init_admin(); } - /* specific admin mode methods */ + /* Specific admin mode methods */ /** * Initialise module object in admin/main mode @@ -220,20 +231,20 @@ final class Admin_GenericGuestBookManager extends Module { /* get data */ $this->adminTitle = $this->title; - /* load list parameters*/ + /* Load list parameters*/ $this->load_library('Admin_GenericGuestBookManagerMessageListParams'); - /* initialise object list input */ + /* Initialise object list input */ $this->msgList = &$camyks->inputs['AdminItemListViewer']; /* add parameters */ $this->msgList->set_params($this->msgListParams); - /* initialise input */ + /* Initialise input */ $this->msgList->initialise(); - /* load tabs */ + /* Load tabs */ $this->tabBuilder = &$camyks->inputs['TabBuilder']; - /* check for config panel */ + /* Check for config panel */ if ($this->check_right(2) !== false) { $this->tabBuilder->add_tab(array( 'name' => 'Config', @@ -247,7 +258,7 @@ final class Admin_GenericGuestBookManager extends Module { 'title' => $this->get_translation('messages'), )); - /* initialise tabs */ + /* Initialise tabs */ $this->tabBuilder->initialise(array('default'=>'Messages')); /* get buttons */ @@ -264,16 +275,16 @@ final class Admin_GenericGuestBookManager extends Module { private function init_admin_viewMsg(){ global $camyks; - /* check item id */ + /* Check item id */ if (!isset($_REQUEST['msg_id'])) return $this->init_admin_main(); - /* load message */ + /* Load message */ $this->msgItem->id = (int)$_REQUEST['msg_id']; $this->msgItem->get(); $this->msgItem->get_fromItems(); - /* load interface title */ + /* Load interface title */ $this->adminTitle = $this->get_translation('title_msgid', $this->msgItem->id); /* build buttons list */ @@ -282,7 +293,7 @@ final class Admin_GenericGuestBookManager extends Module { 'title' => $camyks->get_translation('back'), )); - /* update layout */ + /* Update layout */ $this->set_selectedLayout('admin_view_msg.html.inc'); } @@ -293,7 +304,7 @@ final class Admin_GenericGuestBookManager extends Module { private function init_admin_editMsg() { global $camyks; - /* check rights */ + /* Check rights */ if ($this->check_right(1) === false) return $this->init_admin_actionNotAllowed(); @@ -311,7 +322,7 @@ final class Admin_GenericGuestBookManager extends Module { $this->editform->set_object($this->msgItem); $this->editform->add_hidden('msg_id', $this->msgItem->id); - /* load interface title */ + /* Load interface title */ if ($this->msgItem->id == 0 ) $this->adminTitle = $this->get_translation('title_newmsg'); else @@ -329,7 +340,7 @@ final class Admin_GenericGuestBookManager extends Module { ), ); - /* update layout */ + /* Update layout */ $this->set_selectedLayout('admin_edit_msg.html.inc'); } @@ -340,14 +351,14 @@ final class Admin_GenericGuestBookManager extends Module { private function init_admin_saveMsg() { global $camyks; - /* check rights */ + /* Check rights */ if ($this->check_right(1) === false) return $this->init_admin_actionNotAllowed(); /* disable admin menu */ $this->disable_adminEngineMenus(); - /* check item id */ + /* Check item id */ if (!isset($_REQUEST['msg_id'])) return $this->init_admin_main(); @@ -360,7 +371,7 @@ final class Admin_GenericGuestBookManager extends Module { $this->text = $this->get_translation('message_notsaved'); } - /* update layout */ + /* Update layout */ $this->set_selectedLayout('admin_message.html.inc', 'camyks'); $this->set_redirect($this->get_adminLink()); } @@ -372,14 +383,14 @@ final class Admin_GenericGuestBookManager extends Module { private function init_admin_deleteMsg() { global $camyks; - /* check rights */ + /* Check rights */ if ($this->check_right(1) === false) return $this->init_admin_actionNotAllowed(); /* disable admin menu */ $this->disable_adminEngineMenus(); - /* check item id */ + /* Check item id */ if (!isset($_REQUEST['msg_id'])) return $this->init_admin_main(); @@ -391,7 +402,7 @@ final class Admin_GenericGuestBookManager extends Module { $this->text = $this->get_translation('message_notdeleted'); } - /* update layout */ + /* Update layout */ $this->set_selectedLayout('admin_message.html.inc', 'camyks'); $this->set_redirect($this->get_adminLink()); } @@ -403,14 +414,14 @@ final class Admin_GenericGuestBookManager extends Module { private function init_admin_editConfig() { global $camyks; - /* check user rights */ + /* Check user rights */ if ($this->check_right(2) === false) return $this->init_admin_actionNotAllowed(); - /* load config */ + /* Load config */ $this->config->get(); - /* load external data */ + /* Load external data */ $this->userList = $camyks->modules['Admin_User']->get_activeUserList(true); /* get configuration form */ @@ -439,7 +450,7 @@ final class Admin_GenericGuestBookManager extends Module { ) ); - /* update layout */ + /* Update layout */ $this->selected_layout = 'admin_edit_config.html.inc'; } @@ -450,21 +461,21 @@ final class Admin_GenericGuestBookManager extends Module { private function init_admin_saveConfig() { global $camyks; - /* check user rights */ + /* Check user rights */ if ($this->check_right(2) === false) return $this->init_admin_actionNotAllowed(); /* disable admin menu */ $this->disable_adminEngineMenus(); - /* save config */ + /* Save config */ $this->config->get_fromHeader(); if ( $this->config->save()) $this->text = $this->get_translation('config_saved'); else $this->text = $this->get_translation('config_notsaved'); - /* update layout */ + /* Update layout */ $this->set_selectedLayout('admin_message.html.inc', 'camyks'); $this->set_redirect(4, $this->get_adminLink()); } @@ -549,22 +560,22 @@ final class Admin_GenericGuestBookManager extends Module { private function send_notifications() { global $camyks; - /* check for notifications status */ + /* Check for notifications status */ if ($this->get_configValue('notification_status') == 0) return true; - /* load sender & recipients */ + /* Load sender & recipients */ $sender = $this->get_configValue('notification_sender'); $recipients = $this->get_configValue('notification_recipients'); - /* check sender & recipients */ + /* Check sender & recipients */ if ($sender == '' or count($recipients) == 0) return true; - /* load content */ + /* Load content */ $subject = string_html2Text($this->get_translation('notification_emailsubject'), 'ISO-8859-1'); - /* send email */ + /* Send email */ foreach ($recipients as $rec) { $this->admin = new AdminUser($rec); $this->admin->get(); @@ -585,7 +596,7 @@ final class Admin_GenericGuestBookManager extends Module { private function get_notificationContent() { global $camyks; - /* load CSS */ + /* Load CSS */ $css = $camyks->themes[$camyks->get_confValue('site_default_theme')]->get_filePath('email.css'); /* build html page */ @@ -601,24 +612,24 @@ final class Admin_GenericGuestBookManager extends Module { return $c; } - /* statistics related methods */ + /* Statistics related methods */ /** - * update statistics + * Update statistics * @return boolean success */ private function update_statistics() { global $camyks; - /* check for statistics status */ + /* Check for statistics status */ if ($this->get_configValue('statistic_status') == 0) return true; - /* update statistics */ + /* Update statistics */ return $camyks->update_statistic('guestbook_msg', $this->name, 'dated', '', '', ''); } - /* specific tool methods */ + /* Specific tool methods */ /** * Return config value. @@ -646,7 +657,7 @@ final class Admin_GenericGuestBookManager extends Module { public function initialise_configDisplay() { $this->isConfig = true; - /* load config */ + /* Load config */ $this->config->get(); } @@ -668,13 +679,13 @@ final class Admin_GenericGuestBookManager extends Module { $this->isConfig = true; - /* load config */ + /* Load config */ $this->config->get(); - /* load external data */ + /* Load external data */ $this->userList = $camyks->modules['Admin_User']->get_activeUserList(true); - /* update form */ + /* Update form */ $this->configform = &$form; $this->configform->set_object($this->config); $this->configform->add_hidden('notification_recipients_count_', count($this->userList)); diff --git a/plugin/module/Admin_GenericMediaLibraryManager/Admin_GenericMediaLibraryManager.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/Admin_GenericMediaLibraryManager.php.inc index a26f3478..155d8fc7 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/Admin_GenericMediaLibraryManager.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/Admin_GenericMediaLibraryManager.php.inc @@ -1,969 +1,996 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Jun 2015 - * Last Modif Date : Nov 2017 - * History : - * * 15-06-24 : Initial files - * - * Admin_GenericMediaLibraryManager - */ - -class Admin_GenericMediaLibraryManager extends Module { - /* variables */ - var $config; - var $documentItem; - var $pictureGalleryItem; - var $documentList; - var $categoryList; - - /* - * constructor - * @param string $path_type - */ - function Admin_GenericMediaLibraryManager ( $path_type ) { - global $camyks; - parent::Module('Admin_GenericMediaLibraryManager', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'content'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Generic'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* load plugin libraries */ - $this->libs[] = 'Admin_GenericMediaLibraryManagerConfig.php.inc'; - $this->libs[] = 'Admin_GenericMediaLibraryManagerPictureGallery.php.inc'; - $this->libs[] = 'Admin_GenericMediaLibraryManagerPicture.php.inc'; - $this->get_PHPLibs(); - - /* initialise plugin libraries */ - $this->config = new Admin_GenericMediaLibraryManagerConfig('config', $this); - $this->pictureGalleryItem = new Admin_GenericMediaLibraryManagerPictureGallery(0, $this); - $this->pictureItem = new Admin_GenericMediaLibraryManagerPicture(0, $this); - - /* initialise plugin variables */ - $this->pictureGalleryList = null; - $this->pictureList = null; - - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - return ($this->config->install() and $this->pictureItem->install() - and $this->pictureGalleryItem->install() and parent::install()); - } - - /* - * unintall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - return parent::uninstall(); - } - - /* - * check module installation - * @return boolean result - * @access private - */ - function is_installed () { - return $this->pictureItem->is_installed(); - } - - /* - * get module rights - * @return void - * @access private - */ - function get_rights() { - global $camyks; - $this->rights[0] = array('name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> true); - $this->rights[1] = array('name'=>'config', - 'title'=> $this->get_translation('rights_config'), - 'default'=> false); - $this->rights[2] = array('name'=>'category', - 'title'=> $this->get_translation('rights_picturegalleries'), - 'default'=> false); - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - - /* check user rights */ - if ( $this->check_right(0) === false ) - return $this->init_admin_accessDenied(); - - /* check dependencies */ - if(!isset($camyks->inputs['TabBuilder'])) - return $this->init_admin_missingPlugin('Input', 'TabBuilder'); - if (!isset($camyks->inputs['AdminItemListViewer'])) - return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); - if (!isset($camyks->inputs['TinyMCEv3'])) - return $this->init_admin_missingPlugin('Input', 'TinyMCEv3'); - - /* load config */ - $this->config->get(); - - /* get informations */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'main' ); - - switch ( $this->mode ) { - case 'edit_config': - /* mode == edit_config */ - $this->init_admin_edit_config(); - break; - case 'save_config': - /* mode == save_config */ - $this->init_admin_save_config(); - break; - case 'view_pictureGallery': - /* mode == view_pictureGallery */ - $this->init_admin_view_pictureGallery(); - break; - case 'edit_pictureGallery': - /* mode == edit_pictureGallery */ - $this->init_admin_edit_pictureGallery(); - break; - case 'save_pictureGallery': - /* mode == save_pictureGallery */ - $this->init_admin_save_pictureGallery(); - break; - case 'delete_pictureGallery': - /* mode == delete_pictureGallery */ - $this->init_admin_delete_pictureGallery(); - break; - case 'edit_picture': - /* mode == edit_picture */ - $this->init_admin_edit_picture(); - break; - case 'save_picture': - /* mode == save_picture */ - $this->init_admin_save_picture(); - break; - case 'delete_picture': - /* mode == delete_picture */ - $this->init_admin_delete_picture(); - break; - case 'moveUp_picture': - /* mode == moveUp_picture */ - $this->init_admin_moveUp_picture(); - break; - case 'moveDown_picture': - /* mode == moveDown_picture */ - $this->init_admin_moveDown_picture(); - break; - case 'main': - default: - /* mode == main */ - $this->init_admin_main(); - } - - parent::init_admin(); - } - - /* - * execute module object in request mode - * @return void - * @access private - */ - function execute_request() { - global $camyks; - - /* build error message */ - $error = array('title'=>$this->get_translation('downloadfailed'), - 'description'=>$this->get_translation('downloaderror'), - 'content1'=>$this->get_translation('downloaderror2')); - - /* load mode to execute */ - $mode = isset($_REQUEST['mode'])?$_REQUEST['mode']:''; - - /* execute mode */ - switch ($mode) { - case 'optimisePictureImage': - $this->execute_request_optimisePictureImage(); break; - case 'optimisePictureThumb': - $this->execute_request_optimisePictureThumb(); break; - default : - /* throw fatal error */ - $camyks->throwFatalError( $error ); - } - } - - /* specific admin mode methods */ - - /* - * init module object in admin/main mode - * @return void - * @access private - */ - function init_admin_main() { - global $camyks; - - /* get help */ - $this->get_help(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - - /* build picture galleries tab */ - $this->load_file('lib/Admin_GenericMediaLibraryManagerPictureGalleryListParams.php.inc'); - $this->pictureGalleryList = new AdminItemListViewer('camyks'); - $this->pictureGalleryList->set_params($this->pictureGalleryListParams); - $this->pictureGalleryList->initialise(); - - /* update picture count in galleries */ - $galleryIds = array_keys($this->pictureGalleryList->objectList); - $cnts = $this->pictureItem->get_pictureCountByGalleries($galleryIds); - foreach( $this->pictureGalleryList->objectList as $id => $gallery) - $this->pictureGalleryList->objectList[$id]->vars['pictures'] = isset($cnts[$id])?$cnts[$id]:0; - - /* build configuration tab */ - $this->configResizeModeList = $this->get_configResizeModeList(); - $this->configFileTypeList = $this->get_configFileTypeList(); - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - - /* add picture galleries tab */ - $this->tabBuilder->add_tab(array('name'=>'PictureGalleries', - 'title'=>$this->get_translation('tabpicturegalleries'))); - - /* add configuration tab */ - if ( $this->check_right(1) === true ) - $this->tabBuilder->add_tab(array('name'=>'Configuration', - 'title'=>$this->get_translation('tabconfiguration'))); - /* add help tab */ - if ( $this->help != null ) - $this->tabBuilder(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'PictureGalleries')); - - /* get buttons */ - $this->buttons = array(array('link'=>$camyks->get_adminLink(), - 'title'=>$camyks->get_translation('back'))); - } - - /* - * init module object in admin/edit_config mode - * @return void - * @access private - */ - function init_admin_edit_config() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* build config form */ - $this->configform = new HTMLForm('configform', - $camyks->get_adminLink($this->name, array('mode' => 'save_config')), - 'POST'); - $this->configform->set_object($this->config); - - /* load data */ - $this->configResizeModeList = $this->get_configResizeModeList(); - $this->configFileTypeList = $this->get_configFileTypeList(); - - /* get buttons */ - $this->buttons = array(array('link'=>$this->get_adminLink(), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->configform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - /* set interface title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - $this->adminTitle .= $this->get_translation('edit_config'); - - /* update layout */ - $this->selected_layout = 'configuration/admin_edit.html.inc'; - } - - /* - * init module object in admin/save_config mode - * @return void - * @access private - */ - function init_admin_save_config() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save config */ - $this->config->get_fromHeader(); - if ( $this->config->save() ) { - $this->text = $this->get_translation('config_saved'); - } else { - $this->text = $this->get_translation('config_notsaved'); - } - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect($camyks->get_confValue('ModuleActionDelay'), $this->get_adminLink(array('openTab'=>'Configuration'))); - } - - /* - * init module object in admin/view_pictureGallery mode - * @return void - * @access private - */ - function init_admin_view_pictureGallery() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - - /* get pictureGallery item */ - $this->pictureGalleryItem->id = isset($_REQUEST['pictureGallery_id'])?(int)$_REQUEST['pictureGallery_id']:0; - $this->pictureGalleryItem->get(); - $this->pictureGalleryItem->get_fromItems(); - - /* no selected gallery, try to create new one */ - if ( $this->pictureGalleryItem->id == 0) - $this->init_admin_edit_pictureGallery(); - - /* load pictures list */ - $this->load_file('lib/Admin_GenericMediaLibraryManagerPictureListParams.php.inc'); - $this->pictureList = new AdminItemListViewer('camyks'); - $this->pictureList->set_params($this->pictureListParams); - $this->pictureList->initialise(); - - /* load data */ - $this->pictureGalleryStatusList = $this->get_pictureGalleryStatusList(); - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - - /* add picture galleries tab */ - $this->tabBuilder->add_tabs(array( - array('name'=>'Properties', - 'title'=>$this->get_translation('tabproperties')), - array('name'=>'Pictures', - 'title'=>$this->get_translation('pictures')), - )); - - /* add help tab */ - if ( $this->help != null ) - $this->tabBuilder(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'Properties')); - - /* check preview max width */ - $this->previewWidth = min(250, $this->get_configValue('picture_thumbWidth')); - - /* add scripts */ - $this->add_JSFile('PictureList.js'); - $this->add_JSScript('var pl = new PictureList("pl");'); - $this->add_JSScript('pl.set_param("previewMaxWidth", '.$this->previewWidth.');'); - $this->add_JSScript('pl.set_param("picturesURL", new Array());'); - if (count($this->pictureList->objectList) > 0) { - foreach ($this->pictureList->objectList as $img) { - $this->add_JSScript('pl.set_param("picturesURL", '.$img->id.', "'.$img->vars['thumb'].'");'); - } - } - $this->add_JSLoadScript('pl.initialise();'); - - /* build button list */ - $this->buttons = array(array('link'=>$this->get_adminLink(array('openTab'=>'PictureGalleries')), - 'title'=>$camyks->get_translation('back'))); - - /* set interface title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - $this->adminTitle .= $this->get_translation('pictureGalleryid', $this->pictureGalleryItem->id); - - /* update layout */ - $this->selected_layout = 'admin_view_pictureGallery.html.inc'; - } - - - /* - * init module object in admin/edit_pictureGallery mode - * @return void - * @access private - */ - function init_admin_edit_pictureGallery() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - - /* get pictureGallery item */ - $pictureGallery_id = isset($_REQUEST['pictureGallery_id'])?(int)$_REQUEST['pictureGallery_id']:0; - $this->pictureGalleryItem->id = $pictureGallery_id; - $this->pictureGalleryItem->get(); - $this->pictureGalleryItem->get_fromItems(); - - /* get form */ - $this->editform = new HTMLForm('edit_pictureGallery', - $this->get_adminlink(array('mode'=>'save_pictureGallery')), - 'POST'); - $this->editform->set_object($this->pictureGalleryItem); - $this->editform->add_hidden('pictureGallery_id', $this->pictureGalleryItem->id ); - - /* load pictures list */ - $this->load_file('lib/Admin_GenericMediaLibraryManagerPictureSelectionListParams.php.inc'); - $this->pictureList = new AdminItemListViewer('camyks'); - $this->pictureList->set_params($this->pictureListParams); - $this->pictureList->initialise(); - - /* load data */ - $this->pictureGalleryStatusList = $this->get_pictureGalleryStatusList(); - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - - /* add picture galleries tab */ - $this->tabBuilder->add_tabs(array( - array('name'=>'Properties', - 'title'=>$this->get_translation('tabproperties')), - array('name'=>'Pictures', - 'title'=>$this->get_translation('defaultpicture')), - )); - foreach ($camyks->_conf['editing_languages'] as $l ) { - $this->tabBuilder->add_tab(array('name'=>$l, - 'title'=>language_getIcon($l))); - } - - /* add help tab */ - if ( $this->help != null ) - $this->tabBuilder(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'Properties')); - - /* get editor input */ - $this->input = &$camyks->inputs['TinyMCEv3']; - $this->input->initialise(); - - /* check preview max width */ - $this->previewWidth = min(250, $this->get_configValue('picture_thumbWidth')); - - /* add scripts */ - $this->add_JSFile('PictureList.js'); - $this->add_JSScript('var pl = new PictureList("pl");'); - $this->add_JSScript('pl.set_param("previewMaxWidth", '.$this->previewWidth.');'); - $this->add_JSScript('pl.set_param("picturesURL", new Array());'); - if (count($this->pictureList->objectList) > 0) { - foreach ($this->pictureList->objectList as $img) { - $this->add_JSScript('pl.set_param("picturesURL", '.$img->id.', "'.$img->vars['thumb'].'");'); - } - } - $this->add_JSLoadScript('pl.initialise();'); - - /* set interface title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - if ($this->pictureGalleryItem->id == 0 ) { - $this->adminTitle .= $this->get_translation('newpictureGallery'); - $this->buttons = array(array('link'=>$this->get_adminLink(array('openTab'=>'PictureGalleries')), - 'title'=>$camyks->get_translation('back'))); - } else { - $this->adminTitle .= $this->get_translation('pictureGalleryid', $this->pictureGalleryItem->id); - $this->buttons = array(array('link'=>$this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureGalleryItem->id)), - 'title'=>$camyks->get_translation('back'))); - } - - /* add valid button */ - $this->buttons[] = array('link'=>$this->editform->get_HTMLSubmitLink(), 'title'=>$camyks->get_translation('valid')); - - /* update layout */ - $this->selected_layout = 'admin_edit_pictureGallery.html.inc'; - } - - /* - * init module object in admin/save_pictureGallery mode - * @return void - * @access private - */ - function init_admin_save_pictureGallery() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check pictureGallery id */ - if(!isset($_REQUEST['pictureGallery_id'])) - return $this->init_admin_main(); - $pictureGallery_id = (int)$_REQUEST['pictureGallery_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save pictureGallery */ - $this->pictureGalleryItem->id = $pictureGallery_id; - $this->pictureGalleryItem->get_fromHeader(); - if ( $this->pictureGalleryItem->save() ) - $this->text = $this->get_translation('pictureGallery_saved'); - else - $this->text = $this->get_translation('pictureGallery_notsaved'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect($this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureGalleryItem->id))); - } - - /* - * init module object in admin/delete_pictureGallery mode - * @return void - * @access private - */ - function init_admin_delete_pictureGallery() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check pictureGallery id */ - if(!isset($_REQUEST['pictureGallery_id'])) - return $this->init_admin_main(); - $pictureGallery_id = $_REQUEST['pictureGallery_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* delete pictureGallery */ - $this->pictureGalleryItem->id = $pictureGallery_id; - if ( $this->pictureGalleryItem->delete()) - $this->text = $this->get_translation('pictureGallery_deleted'); - else - $this->text = $this->get_translation('pictureGallery_notdeleted'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect($this->get_adminLink(array('openTab'=>'PictureGalleries'))); - } - - /* - * init module object in admin/edit_picture mode - * @return void - * @access private - */ - function init_admin_edit_picture() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* get language to use with content */ - $lg = $this->get_adminEditionLanguage(); - - /* get picture item */ - $this->pictureItem->id = isset($_REQUEST['picture_id'])?(int)$_REQUEST['picture_id']:0; - $this->pictureItem->get(); - $this->pictureItem->get_fromItems(); - - if ($this->pictureItem->id == 0 and !isset($_REQUEST['gallery'])) { - /* no gallery defined for new picture */ - - } elseif ($this->pictureItem->id == 0) { - /* set gallery value */ - $this->pictureItem->vars['gallery'] = (int)$_REQUEST['gallery']; - } - - /* create form */ - $this->editform = new HTMLForm('edit_picture', - $this->get_adminlink(array('mode'=>'save_picture')), - 'POST'); - $this->editform->allow_files(true, $this->config->vars['picture_maxFileSize']*1024*1024 ); - $this->editform->set_object($this->pictureItem); - $this->editform->add_hidden('picture_id', $this->pictureItem->id ); - $this->editform->add_hidden('gallery', $this->pictureItem->vars['gallery']); - $this->editform->add_hidden('sortPosition', $this->pictureItem->vars['sortPosition']); - - /* build title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - if ($this->pictureItem->id == 0 ) - $this->adminTitle .= $this->get_translation('newpicture'); - else - $this->adminTitle .= $this->get_translation('pictureid', $this->pictureItem->id); - - /* build button list */ - $this->buttons = array(array('link'=>$this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures')), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->editform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - - /* update layout */ - $this->selected_layout = 'admin_edit_picture.html.inc'; - } - - /* - * init module object in admin/save_picture mode - * @return void - * @access private - */ - function init_admin_save_picture() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check picture id */ - if ( !isset($_REQUEST['picture_id'])) - return $this->init_admin_main(); - $picture_id = $_REQUEST['picture_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save picture */ - $this->pictureItem->id = $picture_id; - $this->pictureItem->get_fromHeader(); - if ($c = $this->pictureItem->save() ) - if ($this->pictureItem->autoDisabled == 1) - $this->text = $this->get_translation('picture_autodisabled'); - else - $this->text = $this->get_translation('picture_saved'); - else - $this->text = $this->get_translation('picture_notsaved'); - $this->pictureItem->get_fromItems(); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - - /* check for picture optimisations */ - if ($c and $this->pictureItem->has_newPicture()) { - /* load scripts */ - $this->add_JSEngineFile('tool/xml.js'); - $this->add_JSEngineFIle('object/cajaxrequest.js'); - $this->add_JSFile('PictureSaving.js'); - $this->add_JSScript('var ps = new PictureSaving("ps");'); - $this->add_JSScript('ps.set_param("pictureId", '.$this->pictureItem->id.');'); - $this->add_JSScript('ps.set_param("requestBaseURL", "request.php?module='.$this->name.'");'); - $this->add_JSScript('ps.set_param("backURL", "'.$this->get_adminJSLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures')).'");'); - $this->add_JSScript('ps.set_param("quitDelay", '.$camyks->get_confValue('ModuleActionDelay').');'); - $this->add_JSScript('ps.set_locale("picture_saved", "'.$this->get_translation('pictureimage_saved').'");'); - $this->add_JSScript('ps.set_locale("thumb_saved", "'.$this->get_translation('picturethumb_saved').'");'); - $this->add_JSLoadScript('ps.initialise();'); - } else - $this->set_redirect($this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); - } - - /* - * init module object in admin/delete_picture mode - * @return void - * @access private - */ - function init_admin_delete_picture() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed () ; - - /* check picture id */ - if ( !isset($_REQUEST['picture_id'])) - return $this->init_admin_main(); - $picture_id = $_REQUEST['picture_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* delete picture */ - $this->pictureItem->id = $picture_id; - $this->pictureItem->get(); - $this->pictureItem->get_fromItems(); - if ( $this->pictureItem->delete()) - $this->text = $this->get_translation('picture_deleted'); - else - $this->text = $this->get_translation('picture_notdeleted'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect($this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); - } - - /* - * init module object in admin/moveUp_picture mode - * @return void - * @access private - */ - function init_admin_moveUp_picture() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - if (!isset($_REQUEST['picture_id'])) - return $this->init_admin_main(); - - /* try to moveup item */ - $this->pictureItem->id = (int)$_REQUEST['picture_id']; - $this->pictureItem->get(); - $this->pictureItem->get_fromItems(); - $this->pictureItem->update_moveUp(); - - /* update layout */ - $this->selected_layout = '__'; - $this->set_redirect(0, $this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); - } - - /* - * init module object in admin/moveDown_picture mode - * @return void - * @access private - */ - function init_admin_moveDown_picture() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - if (!isset($_REQUEST['picture_id'])) - return $this->init_admin_main(); - - /* try to moveup item */ - $this->pictureItem->id = (int)$_REQUEST['picture_id']; - $this->pictureItem->get(); - $this->pictureItem->get_fromItems(); - $this->pictureItem->update_moveDown(); - - /* update layout */ - $this->selected_layout = '__'; - $this->set_redirect(0, $this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); - } - - /* specific request mode methods */ - - /* - * execute module object in picture picture optimisation mode - * @return void - * @access private - */ - function execute_request_optimisePictureImage() { - global $camyks; - - /* load camyks engine */ - $camyks->get_siteInit(); - - /* load parameters and picture object */ - if (!isset($_REQUEST['picture_id'])) - return; - $this->pictureItem->id = (int)$_REQUEST['picture_id']; - if ($this->pictureItem->id == 0 or !$this->pictureItem->get($camyks->current_language)) - return; - $this->pictureItem->get_fromItems(); - $result = new CRequestAnswer(array('status'=>'failure')); - if ($this->pictureItem->optimise_picture()) - $result->update_params(array('status'=>'success')); - $result->send_asXML(array('action'=>'optimisePictureImage')); - } - - /* - * execute module object in picture thumb optimisation mode - * @return void - * @access private - */ - function execute_request_optimisePictureThumb() { - global $camyks; - - /* load camyks engine */ - $camyks->get_siteInit(); - - /* load parameters and picture object */ - if (!isset($_REQUEST['picture_id'])) - return; - $this->pictureItem->id = (int)$_REQUEST['picture_id']; - if ($this->pictureItem->id == 0 or !$this->pictureItem->get($camyks->current_language)) - return; - $this->pictureItem->get_fromItems(); - $result = new CRequestAnswer(array('status'=>'failure')); - if ($this->pictureItem->optimise_thumb()) - $result->update_params(array('status'=>'success')); - $result->send_asXML(array('action'=>'optimisePictureThumb')); - } - - /* specific admin tool methods */ - - /* - * return given config item value - * @param string $item - * @return mixed - * @access private - */ - function get_configValue($item) { - if (!isset($this->config->vars)) - $this->config->get(); - if (isset($this->config->vars[$item])) - return $this->config->vars[$item]; - return false; - } - - /* - * return config resize mode list - * @return array - * @access private - */ - function get_configResizeModeList() { - return $this->config->get_resizeModeList(); - } - - /* - * return config resize mode list - * @return array - * @access private - */ - function get_configFileTypeList() { - return $this->config->get_fileTypeList(); - } - - /* - * return picture gallery status list - * @return array - * @access private - */ - function get_pictureGalleryStatusList() { - return $this->pictureGalleryItem->get_statusList(); - } - - /* - * return picture galleries status list - * @param boolean $full - * @return array - * @access private - */ - function get_pictureGalleriesStatusList($full=false) { - return $this->pictureGalleryItem->get_multiStatusList($full); - } - - /* - * return picture galleries title list - * @param boolean $full - * @return array - * @access private - */ - function get_pictureGalleriesTitleList($params=array()) { - return $this->pictureGalleryItem->get_titleList($params); - } - - /* - * return picture gallery status icon list - * @return array - * @access private - */ - function get_pictureGalleryStatusIconList() { - return $this->pictureGalleryItem->get_statusIconList(); - } - - /* - * return picture gallery list - * @param array $params - * @return array - * @access private - */ - function get_pictureGalleryList($params=array()) { - return $this->pictureGalleryItem->get_list($params); - } - - /* - * return picture gallery count - * @param array $params - * @return array - * @access private - */ - function count_pictureGalleries($params=array()) { - return $this->pictureGalleryItem->count($params); - } - - /* - * return picture status list - * @return array - * @access private - */ - function get_pictureStatusList() { - return $this->pictureItem->get_statusList(); - } - - /* - * return pictures status list - * @param boolean $full - * @return array - * @access private - */ - function get_picturesStatusList($full=false) { - return $this->pictureItem->get_multiStatusList($full); - } - - /* - * return picture list - * @param array $params - * @return array - * @access private - */ - function get_pictureList($params=array()) { - return $this->pictureItem->get_list($params); - } - - /* - * return picture count - * @param array $params - * @return array - * @access private - */ - function count_pictures($params=array()) { - return $this->pictureItem->count($params); - } - - /* - * return first picture list - * @param array $params - * @return array - * @access private - */ - function get_firstPicturesList($params=array()) { - return $this->pictureItem->get_firstList($params); - } -} -?> \ No newline at end of file + Manages media libraries. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericMediaLibraryManager class. + */ +final class Admin_GenericMediaLibraryManager extends Module { + /** + * var Object $pictureItem + * @brief Picture object. + */ + public $pictureItem; + + /** + * var array $pictureList + * @brief Picture list. + */ + public $pictureList = null; + + /** + * var Object $pictureGalleryItem + * @brief Picture gallery object. + */ + public $pictureGalleryItem; + + /** + * var array $pictureGalleryList + * @brief Picture gallery list. + */ + public $pictureGalleryList = null; + + /** + * var Object $config + * @brief Plugin configuration. + */ + protected $config; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_GenericMediaLibraryManager', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'Generic'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'content'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load plugin libraries */ + $this->load_library('Admin_GenericMediaLibraryManagerConfig'); + $this->load_library('Admin_GenericMediaLibraryManagerPictureGallery'); + $this->load_library('Admin_GenericMediaLibraryManagerPicture'); + + /* Initialise plugin libraries */ + $this->config = new Admin_GenericMediaLibraryManagerConfig('config', $this); + $this->pictureGalleryItem = new Admin_GenericMediaLibraryManagerPictureGallery(0, $this); + $this->pictureItem = new Admin_GenericMediaLibraryManagerPicture(0, $this); + } + + /* Override Module methods */ + + /** + * Install module. + * @return boolean success + */ + public function install() { + return ($this->config->install() and $this->pictureItem->install() + and $this->pictureGalleryItem->install() and parent::install()); + } + + /** + * Unintall module. + * @return boolean success + */ + public function uninstall() { + return parent::uninstall(); + } + + /** + * Check module installation. + * @return boolean result + */ + public function is_installed() { + return $this->pictureItem->is_installed(); + } + + /** + * Define module permissions. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => true, + ); + $this->rights[1] = array( + 'name' => 'config', + 'title' => $this->get_translation('rights_config'), + 'default' => false, + ); + $this->rights[2] = array( + 'name' => 'edit', + 'title' => $this->get_translation('rights_picturegalleries'), + 'default' => false, + ); + } + + /** + * Initialise module object in admin mode + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check read permission */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Check dependencies */ + if (!isset($camyks->inputs['TabBuilder'])) + return $this->init_admin_missingPlugin('Input', 'TabBuilder'); + if (!isset($camyks->inputs['AdminItemListViewer'])) + return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); + if (!isset($camyks->inputs['TinyMCEv3'])) + return $this->init_admin_missingPlugin('Input', 'TinyMCEv3'); + + /* Load configuration */ + $this->config->get(); + + /* Load action to execute */ + $this->mode = isset ($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'; + + switch ($this->mode) { + case 'edit_config': + /* mode == edit_config */ + $this->init_admin_edit_config(); + break; + case 'save_config': + /* mode == save_config */ + $this->init_admin_save_config(); + break; + case 'view_pictureGallery': + /* mode == view_pictureGallery */ + $this->init_admin_view_pictureGallery(); + break; + case 'edit_pictureGallery': + /* mode == edit_pictureGallery */ + $this->init_admin_edit_pictureGallery(); + break; + case 'save_pictureGallery': + /* mode == save_pictureGallery */ + $this->init_admin_save_pictureGallery(); + break; + case 'delete_pictureGallery': + /* mode == delete_pictureGallery */ + $this->init_admin_delete_pictureGallery(); + break; + case 'edit_picture': + /* mode == edit_picture */ + $this->init_admin_edit_picture(); + break; + case 'save_picture': + /* mode == save_picture */ + $this->init_admin_save_picture(); + break; + case 'delete_picture': + /* mode == delete_picture */ + $this->init_admin_delete_picture(); + break; + case 'moveUp_picture': + /* mode == moveUp_picture */ + $this->init_admin_moveUp_picture(); + break; + case 'moveDown_picture': + /* mode == moveDown_picture */ + $this->init_admin_moveDown_picture(); + break; + case 'main': + default: + /* mode == main */ + $this->init_admin_main(); + } + + /* Perform generic intialisation */ + parent::init_admin(); + } + + /** + * Execute module object in request mode. + * @return void + */ + public function execute_request() { + global $camyks; + + /* Build error message */ + $error = array( + 'title' => $this->get_translation('downloadfailed'), + 'description' => $this->get_translation('downloaderror'), + 'content1' => $this->get_translation('downloaderror2'), + ); + + /* Load mode to execute */ + $mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : ''; + + /* Execute mode */ + switch ($mode) { + case 'optimisePictureImage': + $this->execute_request_optimisePictureImage(); break; + case 'optimisePictureThumb': + $this->execute_request_optimisePictureThumb(); break; + default : + /* throw fatal error */ + $camyks->throwFatalError($error); + } + } + + /* Specific admin mode methods */ + + /** + * Initialise module object in admin/main mode. + * @return void + */ + private function init_admin_main() { + global $camyks; + + /* Load help */ + $this->get_help(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + + /* Build picture galleries tab */ + $this->load_file('lib/Admin_GenericMediaLibraryManagerPictureGalleryListParams.php.inc'); + $this->pictureGalleryList = new AdminItemListViewer('camyks'); + $this->pictureGalleryList->set_params($this->pictureGalleryListParams); + $this->pictureGalleryList->initialise(); + + /* Update picture count in galleries */ + $galleryIds = array_keys($this->pictureGalleryList->objectList); + $cnts = $this->pictureItem->get_pictureCountByGalleries($galleryIds); + foreach($this->pictureGalleryList->objectList as $id => $gallery) + $this->pictureGalleryList->objectList[$id]->vars['pictures'] = isset($cnts[$id])?$cnts[$id]:0; + + /* Build configuration tab */ + $this->configResizeModeList = $this->get_configResizeModeList(); + $this->configFileTypeList = $this->get_configFileTypeList(); + + /* Load tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + + /* Add picture galleries tab */ + $this->tabBuilder->add_tab(array( + 'name' => 'PictureGalleries', + 'title' => $this->get_translation('tabpicturegalleries'), + )); + + /* Add configuration tab */ + if ($this->check_right(1) === true) + $this->tabBuilder->add_tab(array( + 'name' => 'Configuration', + 'title' => $this->get_translation('tabconfiguration'), + )); + + /* Add help tab */ + if ($this->help != null) + $this->tabBuilder(array( + 'name' => 'help', + 'title' => $camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'PictureGalleries')); + + /* Build button list */ + $this->buttons = array(array( + 'link' => $camyks->get_adminLink(), + 'title' => $camyks->get_translation('back'), + )); + } + + /** + * Initialise module object in admin/edit_config mode. + * @return void + */ + public function init_admin_edit_config() { + global $camyks; + + /* Check user rights */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Build config form */ + $this->configform = new HTMLForm('configform', $this->get_adminLink(array('mode' => 'save_config')), 'POST'); + $this->configform->set_object($this->config); + + /* Load data */ + $this->configResizeModeList = $this->get_configResizeModeList(); + $this->configFileTypeList = $this->get_configFileTypeList(); + + /* Build button list */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->configform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ) + ); + + /* Set interface title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + $this->adminTitle .= $this->get_translation('edit_config'); + + /* Update layout */ + $this->set_selectedLayout('configuration/admin_edit.html.inc'); + } + + /** + * Initialise module object in admin/save_config mode. + * @return void + */ + private function init_admin_save_config() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save configuration */ + $this->config->get_fromHeader(); + if ($this->config->save()) { + $this->text = $this->get_translation('config_saved'); + } else { + $this->text = $this->get_translation('config_notsaved'); + } + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('openTab'=>'Configuration'))); + } + + /** + * Initialise module object in admin/view_pictureGallery mode + * @return void + */ + private function init_admin_view_pictureGallery() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + + /* Load pictureGallery item */ + $this->pictureGalleryItem->id = isset($_REQUEST['pictureGallery_id']) ? (int)$_REQUEST['pictureGallery_id'] : 0; + $this->pictureGalleryItem->get(); + $this->pictureGalleryItem->get_fromItems(); + + /* No selected gallery, try to create new one */ + if ($this->pictureGalleryItem->id == 0) + $this->init_admin_edit_pictureGallery(); + + /* Load pictures list */ + $this->load_library('Admin_GenericMediaLibraryManagerPictureListParams'); + $this->pictureList = new AdminItemListViewer('camyks'); + $this->pictureList->set_params($this->pictureListParams); + $this->pictureList->initialise(); + + /* Load data */ + $this->pictureGalleryStatusList = $this->get_pictureGalleryStatusList(); + + /* Build tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + + /* Add picture galleries tab */ + $this->tabBuilder->add_tabs(array( + array( + 'name' => 'Properties', + 'title' => $camyks->get_translation('properties'), + ), + array( + 'name' => 'Pictures', + 'title' => $this->get_translation('pictures'), + ), + )); + + /* Add help tab */ + if ($this->help != null) + $this->tabBuilder(array( + 'name' => 'help', + 'title' => $camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'Properties')); + + /* Check preview max width */ + $this->previewWidth = min(250, $this->get_configValue('picture_thumbWidth')); + + /* Attach scripts */ + $this->add_JSFile('PictureList.js'); + $this->add_JSScript('var pl = new PictureList("pl");'); + $this->add_JSScript('pl.set_param("previewMaxWidth", '.$this->previewWidth.');'); + $this->add_JSScript('pl.set_param("picturesURL", new Array());'); + if (count($this->pictureList->objectList) > 0) { + foreach ($this->pictureList->objectList as $img) { + $this->add_JSScript('pl.set_param("picturesURL", '.$img->id.', "'.$img->vars['thumb'].'");'); + } + } + $this->add_JSLoadScript('pl.initialise();'); + + /* Build button list */ + $this->buttons = array(array( + 'link' => $this->get_adminLink(array('openTab'=>'PictureGalleries')), + 'title' => $camyks->get_translation('back'), + )); + + /* Set interface title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + $this->adminTitle .= $this->get_translation('pictureGalleryid', $this->pictureGalleryItem->id); + + /* Update layout */ + $this->set_selectedLayout('admin_view_pictureGallery.html.inc'); + } + + /** + * Initialise module object in admin/edit_pictureGallery mode. + * @return void + */ + private function init_admin_edit_pictureGallery() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + + /* Load pictureGallery item */ + $this->pictureGalleryItem->id = isset($_REQUEST['pictureGallery_id']) ? (int)$_REQUEST['pictureGallery_id'] : 0; + $this->pictureGalleryItem->get(); + $this->pictureGalleryItem->get_fromItems(); + + /* Build form */ + $this->editform = new HTMLForm('edit_pictureGallery', $this->get_adminlink(array('mode'=>'save_pictureGallery')), 'POST'); + $this->editform->set_object($this->pictureGalleryItem); + $this->editform->add_hidden('pictureGallery_id', $this->pictureGalleryItem->id); + + /* Load pictures list */ + $this->load_file('lib/Admin_GenericMediaLibraryManagerPictureSelectionListParams.php.inc'); + $this->pictureList = new AdminItemListViewer('camyks'); + $this->pictureList->set_params($this->pictureListParams); + $this->pictureList->initialise(); + + /* Load data */ + $this->pictureGalleryStatusList = $this->get_pictureGalleryStatusList(); + + /* Build tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + + /* Add picture galleries tab */ + $this->tabBuilder->add_tabs(array( + array( + 'name' => 'Properties', + 'title' => $camyks->get_translation('properties'), + ), + array( + 'name' => 'Pictures', + 'title' => $this->get_translation('defaultpicture'), + ), + )); + foreach ($camyks->get_confValue('editing_languages') as $l) { + $this->tabBuilder->add_tab(array( + 'name' => $l, + 'title' => language_getIcon($l), + )); + } + + /* Add help tab */ + if ($this->help != null) + $this->tabBuilder(array( + 'name' => 'help', + 'title' => $camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'Properties')); + + /* Load editor input */ + $this->input = $camyks->get_input('TinyMCEv3'); + $this->input->initialise(); + + /* Check preview max width */ + $this->previewWidth = min(250, $this->get_configValue('picture_thumbWidth')); + + /* Add scripts */ + $this->add_JSFile('PictureList.js'); + $this->add_JSScript('var pl = new PictureList("pl");'); + $this->add_JSScript('pl.set_param("previewMaxWidth", '.$this->previewWidth.');'); + $this->add_JSScript('pl.set_param("picturesURL", new Array());'); + if (count($this->pictureList->objectList) > 0) { + foreach ($this->pictureList->objectList as $img) { + $this->add_JSScript('pl.set_param("picturesURL", '.$img->id.', "'.$img->vars['thumb'].'");'); + } + } + $this->add_JSLoadScript('pl.initialise();'); + + /* Set interface title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + if ($this->pictureGalleryItem->id == 0) { + $this->adminTitle .= $this->get_translation('newpictureGallery'); + $this->buttons = array(array( + 'link' => $this->get_adminLink(array('openTab'=>'PictureGalleries')), + 'title' => $camyks->get_translation('back'), + )); + } else { + $this->adminTitle .= $this->get_translation('pictureGalleryid', $this->pictureGalleryItem->id); + $this->buttons = array(array( + 'link' => $this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureGalleryItem->id)), + 'title' => $camyks->get_translation('back'), + )); + } + + /* Build valid button */ + $this->buttons[] = array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_pictureGallery.html.inc'); + } + + /** + * Initialise module object in admin/save_pictureGallery mode. + * @return void + */ + private function init_admin_save_pictureGallery() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check pictureGallery id */ + if (!isset($_REQUEST['pictureGallery_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save pictureGallery */ + $this->pictureGalleryItem->id = (int)$_REQUEST['pictureGallery_id']; + $this->pictureGalleryItem->get_fromHeader(); + if ($this->pictureGalleryItem->save()) + $this->text = $this->get_translation('pictureGallery_saved'); + else + $this->text = $this->get_translation('pictureGallery_notsaved'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureGalleryItem->id))); + } + + /** + * Initialise module object in admin/delete_pictureGallery mode. + * @return void + */ + private function init_admin_delete_pictureGallery() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check pictureGallery id */ + if (!isset($_REQUEST['pictureGallery_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Delete pictureGallery */ + $this->pictureGalleryItem->id = (int)$_REQUEST['pictureGallery_id']; + if ($this->pictureGalleryItem->delete()) + $this->text = $this->get_translation('pictureGallery_deleted'); + else + $this->text = $this->get_translation('pictureGallery_notdeleted'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('openTab'=>'PictureGalleries'))); + } + + /** + * Initialise module object in admin/edit_picture mode. + * @return void + */ + private function init_admin_edit_picture() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load language to use with content */ + $lg = $this->get_adminEditionLanguage(); + + /* Load picture item */ + $this->pictureItem->id = isset($_REQUEST['picture_id']) ? (int)$_REQUEST['picture_id'] : 0; + $this->pictureItem->get(); + $this->pictureItem->get_fromItems(); + + if ($this->pictureItem->id == 0 and !isset($_REQUEST['gallery'])) { + /* no gallery defined for new picture */ + + } elseif ($this->pictureItem->id == 0) { + /* Set gallery value */ + $this->pictureItem->vars['gallery'] = (int)$_REQUEST['gallery']; + } + + /* Build form */ + $this->editform = new HTMLForm('edit_picture', $this->get_adminlink(array('mode'=>'save_picture')), 'POST'); + $this->editform->allow_files(true, $this->config->get_configValue('picture_maxFileSize')*1024*1024); + $this->editform->set_object($this->pictureItem); + $this->editform->add_hidden('picture_id', $this->pictureItem->id); + $this->editform->add_hidden('gallery', $this->pictureItem->vars['gallery']); + $this->editform->add_hidden('sortPosition', $this->pictureItem->vars['sortPosition']); + + /* Build title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + if ($this->pictureItem->id == 0) + $this->adminTitle .= $this->get_translation('newpicture'); + else + $this->adminTitle .= $this->get_translation('pictureid', $this->pictureItem->id); + + /* Build button list */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures')), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_picture.html.inc'); + } + + /** + * Initialise module object in admin/save_picture mode. + * @return void + */ + private function init_admin_save_picture() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check picture id */ + if (!isset($_REQUEST['picture_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save picture */ + $this->pictureItem->id = (int)$_REQUEST['picture_id']; + $this->pictureItem->get_fromHeader(); + if ($c = $this->pictureItem->save()) + if ($this->pictureItem->autoDisabled == 1) + $this->text = $this->get_translation('picture_autodisabled'); + else + $this->text = $this->get_translation('picture_saved'); + else + $this->text = $this->get_translation('picture_notsaved'); + $this->pictureItem->get_fromItems(); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + + /* Check for picture optimisations */ + if ($c and $this->pictureItem->has_newPicture()) { + /* Load scripts */ + $this->add_JSEngineFile('tool/xml.js'); + $this->add_JSEngineFIle('object/cajaxrequest.js'); + $this->add_JSFile('PictureSaving.js'); + $this->add_JSScript('var ps = new PictureSaving("ps");'); + $this->add_JSScript('ps.set_param("pictureId", '.$this->pictureItem->id.');'); + $this->add_JSScript('ps.set_param("requestBaseURL", "request.php?module='.$this->name.'");'); + $this->add_JSScript('ps.set_param("backURL", "'.$this->get_adminJSLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures')).'");'); + $this->add_JSScript('ps.set_param("quitDelay", '.$camyks->get_confValue('ModuleActionDelay').');'); + $this->add_JSScript('ps.set_locale("picture_saved", "'.$this->get_translation('pictureimage_saved').'");'); + $this->add_JSScript('ps.set_locale("thumb_saved", "'.$this->get_translation('picturethumb_saved').'");'); + $this->add_JSLoadScript('ps.initialise();'); + } else + $this->set_redirect($this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); + } + + /** + * Initialise module object in admin/delete_picture mode + * @return void + */ + private function init_admin_delete_picture() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check picture id */ + if (!isset($_REQUEST['picture_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Delete picture */ + $this->pictureItem->id = (int)$_REQUEST['picture_id']; + $this->pictureItem->get(); + $this->pictureItem->get_fromItems(); + if ($this->pictureItem->delete()) + $this->text = $this->get_translation('picture_deleted'); + else + $this->text = $this->get_translation('picture_notdeleted'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); + } + + /** + * Initialise module object in admin/moveUp_picture mode. + * @return void + */ + private function init_admin_moveUp_picture() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + if (!isset($_REQUEST['picture_id'])) + return $this->init_admin_main(); + + /* Move up item */ + $this->pictureItem->id = (int)$_REQUEST['picture_id']; + $this->pictureItem->get(); + $this->pictureItem->get_fromItems(); + $this->pictureItem->update_moveUp(); + + /* Update layout */ + $this->set_selectedLayout('__'); + $this->set_redirect(0, $this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); + } + + /** + * Initialise module object in admin/moveDown_picture mode. + * @return void + */ + function init_admin_moveDown_picture() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + if (!isset($_REQUEST['picture_id'])) + return $this->init_admin_main(); + + /* Move down item */ + $this->pictureItem->id = (int)$_REQUEST['picture_id']; + $this->pictureItem->get(); + $this->pictureItem->get_fromItems(); + $this->pictureItem->update_moveDown(); + + /* Update layout */ + $this->selected_layout = '__'; + $this->set_redirect(0, $this->get_adminLink(array('mode'=>'view_pictureGallery', 'pictureGallery_id'=>$this->pictureItem->vars['gallery'], 'openTab'=>'Pictures'))); + } + + /* Specific request mode methods */ + + /** + * Execute module object in picture picture optimisation mode. + * @return void + */ + private function execute_request_optimisePictureImage() { + global $camyks; + + /* Load camyks engine */ + $camyks->get_siteInit(); + + /* Load parameters and picture object */ + if (!isset($_REQUEST['picture_id'])) + return; + $this->pictureItem->id = (int)$_REQUEST['picture_id']; + if ($this->pictureItem->id == 0 or !$this->pictureItem->get($camyks->current_language)) + return; + $this->pictureItem->get_fromItems(); + $result = new CRequestAnswer(array('status'=>'failure')); + if ($this->pictureItem->optimise_picture()) + $result->update_params(array('status'=>'success')); + $result->send_asXML(array('action'=>'optimisePictureImage')); + } + + /** + * Execute module object in picture thumb optimisation mode. + * @return void + */ + private function execute_request_optimisePictureThumb() { + global $camyks; + + /* Load camyks engine */ + $camyks->get_siteInit(); + + /* Load parameters and picture object */ + if (!isset($_REQUEST['picture_id'])) + return; + $this->pictureItem->id = (int)$_REQUEST['picture_id']; + if ($this->pictureItem->id == 0 or !$this->pictureItem->get($camyks->current_language)) + return; + $this->pictureItem->get_fromItems(); + $result = new CRequestAnswer(array('status'=>'failure')); + if ($this->pictureItem->optimise_thumb()) + $result->update_params(array('status'=>'success')); + $result->send_asXML(array('action'=>'optimisePictureThumb')); + } + + /* Specific admin tool methods */ + + /** + * Return given config item value. + * @param string $item + * @return mixed + */ + public function get_configValue($item) { + if (!isset($this->config->vars)) + $this->config->get(); + if (isset($this->config->vars[$item])) + return $this->config->vars[$item]; + return false; + } + + /** + * Return config resize mode list. + * @return array + */ + protected function get_configResizeModeList() { + return $this->config->get_resizeModeList(); + } + + /** + * Return config resize mode list. + * @return array + */ + protected function get_configFileTypeList() { + return $this->config->get_fileTypeList(); + } + + /** + * Return picture gallery status list. + * @return array + */ + public function get_pictureGalleryStatusList() { + return $this->pictureGalleryItem->get_statusList(); + } + + /** + * Return picture galleries status list. + * @param boolean $full + * @return array + */ + public function get_pictureGalleriesStatusList($full=false) { + return $this->pictureGalleryItem->get_multiStatusList($full); + } + + /** + * Return picture galleries title list. + * @param array $params + * @return array + */ + public function get_pictureGalleriesTitleList($params=array()) { + return $this->pictureGalleryItem->get_titleList($params); + } + + /** + * Return picture gallery status icon list. + * @return array + */ + public function get_pictureGalleryStatusIconList() { + return $this->pictureGalleryItem->get_statusIconList(); + } + + /** + * Return picture gallery list. + * @param array $params + * @return array + */ + public function get_pictureGalleryList($params=array()) { + return $this->pictureGalleryItem->get_list($params); + } + + /** + * Return picture gallery count. + * @param array $params + * @return array + */ + public function count_pictureGalleries($params=array()) { + return $this->pictureGalleryItem->count($params); + } + + /** + * Return picture status list. + * @return array + */ + public function get_pictureStatusList() { + return $this->pictureItem->get_statusList(); + } + + /** + * Return pictures status list. + * @param boolean $full + * @return array + */ + public function get_picturesStatusList($full=false) { + return $this->pictureItem->get_multiStatusList($full); + } + + /** + * Return picture list. + * @param array $params + * @return array + */ + public function get_pictureList($params=array()) { + return $this->pictureItem->get_list($params); + } + + /** + * Return picture count. + * @param array $params + * @return array + */ + public function count_pictures($params=array()) { + return $this->pictureItem->count($params); + } + + /** + * Return first picture list. + * @param array $params + * @return array + */ + public function get_firstPicturesList($params=array()) { + return $this->pictureItem->get_firstList($params); + } +} +?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/html/admin.html.inc b/plugin/module/Admin_GenericMediaLibraryManager/html/admin.html.inc index 794f7e5d..cbc6defa 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/html/admin.html.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/html/admin.html.inc @@ -1,34 +1,33 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0.1 - * Object Type : Plugin / Module Layout - * Creation Date : Apr 2015 - * Last Modif Date : Jul 2018 - * - * Admin_GenericMediaLibraryManager Module Admin Layout : main -*/ -global $camyks; -?> -theme->get_boxHeader(array('class'=>'adminEditorModule'));?> -theme->get_boxTitleBar($this->title) ?> -theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header()?> - -
-pictureGalleryList->display('head');?> -pictureGalleryList->display('list');?> -
- -check_right(1) === true ) : ?> -
-load_file('html/configuration/admin_view.html.inc');?> -
- - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.2.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header(); ?> + +
+ pictureGalleryList->display('head');?> + pictureGalleryList->display('list');?> +
+ +check_right(1) === true) : ?> +
+ load_file('html/configuration/admin_view.html.inc');?> +
+ + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_picture.html.inc b/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_picture.html.inc index 2f2f3d28..482287ba 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_picture.html.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_picture.html.inc @@ -1,70 +1,68 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0.1 - * Object Type : Plugin / Module Layout - * Creation Date : Jun 2015 - * Last Modif Date : Jul 2018 - * - * Admin_GenericMediaLibraryManager Module Admin Layout : edit_picture -*/ -global $camyks; - -$flags = array(); -if (count($camyks->get_confValue('editing_languages')) > 1 ) - foreach ($camyks->get_confValue('editing_languages') as $l) - $flags[$l] = ''; -else - foreach ($camyks->get_confValue('editing_languages') as $l) - $flags[$l] = ''; -?> -theme->get_boxHeader(array('class'=>'adminEditorModule'));?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxContent2Header( )?> -editform->display_header(); ?> -editform->display_hiddens(); ?> -
- - - - - - - - -_conf['editing_languages'] as $l ) : ?> - - - - - - - - - - - - - -
-get_translation('formitem_status')?> - -editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_pictureStatusList()));?> -
- -get_translation('formitem_title');?> - -editform->display_textInput(array('name'=>'title', 'language'=>$l));?> -
-get_translation('document_file')?> (get_translation('maxfilesize', file_getFileSize($this->config->vars['picture_maxFileSize']*1024*1024) )?>) - -editform->display_fileInput('original');?> -
-
-editform->display_footer(); ?> -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.2.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; + +$flags = array(); +if (count($lgs = $camyks->get_confValue('editing_languages')) > 1 ) + foreach ($lgs as $l) + $flags[$l] = ''; +else + foreach ($lgs as $l) + $flags[$l] = ''; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxContent2Header(); ?> +editform->display_header(); ?> +editform->display_hiddens(); ?> +
+ + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + + editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_pictureStatusList())); ?> +
+ + get_translation('formitem_title'); ?> + + editform->display_textInput(array('name'=>'title', 'language'=>$l)); ?> +
+ get_translation('document_file')?> (get_translation('maxfilesize', file_getFileSize($this->config->vars['picture_maxFileSize']*1024*1024) )?>) + + editform->display_fileInput('original'); ?> +
+
+editform->display_footer(); ?> +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_pictureGallery.html.inc b/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_pictureGallery.html.inc index 499f33f3..c9886b8e 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_pictureGallery.html.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_pictureGallery.html.inc @@ -1,106 +1,105 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0.1 - * Object Type : Plugin / Module Layout - * Creation Date : Jun 2015 - * Last Modif Date : Jul 2018 - * - * Admin_GenericMediaLibraryManager Module Admin Layout : edit_pictureGallery -*/ -global $camyks; - -$flags = array(); -if (count($camyks->get_confValue('editing_languages')) > 1 ) - foreach ($camyks->get_confValue('editing_languages') as $l) - $flags[$l] = ''; -else - foreach ($camyks->get_confValue('editing_languages') as $l) - $flags[$l] = ''; -?> -theme->get_boxHeader(array('class'=>'adminEditorModule'));?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header( )?> -editform->display_header(); ?> -editform->display_hiddens(); ?> - -
- - - - - - - -get_confValue('editing_languages') as $l ) : ?> - - - - - - -get_confValue('editing_languages') as $l ) : ?> - - - - - - - - - - - -
-get_translation('formitem_status')?> - -editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_pictureGalleryStatusList()));?> -
- -get_translation('formitem_title')?> - -editform->display_textInput(array('name'=>'title', 'language'=>$l));?> -
- -get_translation('formitem_summary')?> - -editform->display_textAreaInput(array('name'=>'summary', 'language'=>$l, 'class'=>'linputs mceNoEditor'));?> -
-get_translation('formitem_date')?> - -editform->display_dateInput(array('name'=>'cdate', 'objects'=>array('year', 'month', 'day')));?> -
-
- -
-
-
- -
-
- get_translation('photo_preview');?> -
-
-
- pictureList->display('head');?> - pictureList->display('list');?> -
-
- -get_confValue('editing_languages') as $l ) : ?> -
-input->set_contentInfos('text', $this->pictureGalleryItem->vars['content_'.$l] ); ?> -input->set_textareaInfos('content_'.$l, '100%', '400px'); ?> -input->display();?> -
- - -editform->display_footer(); ?> - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.2.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; + +$flags = array(); +if (count($lgs = $camyks->get_confValue('editing_languages')) > 1 ) + foreach ($lgs as $l) + $flags[$l] = ''; +else + foreach ($lgs as $l) + $flags[$l] = ''; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header( ); ?> +editform->display_header(); ?> +editform->display_hiddens(); ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + + editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_pictureGalleryStatusList())); ?> +
+ + get_translation('formitem_title'); ?> + + editform->display_textInput(array('name'=>'title', 'language'=>$l)); ?> +
+ + get_translation('formitem_summary'); ?> + + editform->display_textAreaInput(array('name'=>'summary', 'language'=>$l, 'class'=>'linputs mceNoEditor')); ?> +
+ get_translation('formitem_date'); ?> + + editform->display_dateInput(array('name'=>'cdate', 'objects'=>array('year', 'month', 'day'))); ?> +
+
+ +
+
+
+ +
+
+ get_translation('photo_preview'); ?> +
+
+
+ pictureList->display('head'); ?> + pictureList->display('list'); ?> +
+
+ + +
+ input->set_contentInfos('text', $this->pictureGalleryItem->vars['content_'.$l] ); ?> + input->set_textareaInfos('content_'.$l, '100%', '400px'); ?> + input->display(); ?> +
+ + +editform->display_footer(); ?> + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/html/admin_view_pictureGallery.html.inc b/plugin/module/Admin_GenericMediaLibraryManager/html/admin_view_pictureGallery.html.inc index 293b1294..6a8f2a6b 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/html/admin_view_pictureGallery.html.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/html/admin_view_pictureGallery.html.inc @@ -1,108 +1,109 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0.1 - * Object Type : Plugin / Module Layout - * Creation Date : Jun 2015 - * Last Modif Date : Jul 2018 - * - * Admin_GenericMediaLibraryManager Module Admin Layout : view_pictureGallery -*/ -global $camyks; - -/* define flags */ -$flags = array(); -if (count($camyks->get_confValue('editing_languages')) > 1 ) - foreach ($camyks->get_confValue('editing_languages') as $l) - $flags[$l] = ''; -else - foreach ($camyks->get_confValue('editing_languages') as $l) - $flags[$l] = ''; - -?> -theme->get_boxHeader(array('class'=>'adminEditorModule'));?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header();?> - -
- - - - - - -get_confValue('editing_languages') as $l ) : ?> - - - - - - -get_confValue('editing_languages') as $l ) : ?> - - - - - - - - - - - - - - - - - - - -
- get_translation('formitem_status')?> - - pictureGalleryStatusList[$this->pictureGalleryItem->vars['status']];?> -
- -get_translation('formitem_title')?> - -pictureGalleryItem->vars['title_'.$l];?> -
- -get_translation('formitem_summary')?> - -pictureGalleryItem->vars['summary_'.$l];?> -
- get_translation('formitem_date')?> - - pictureGalleryItem->vars['cdate']);?> -
-   -
- theme->get_button(array('title'=>$this->get_translation('edit_properties'), - 'url'=>$this->get_adminLink(array('mode'=>'edit_pictureGallery', 'pictureGallery_id'=>$this->pictureGalleryItem->id)))); ?> -
-
- -
-
-
- -
-
- get_translation('photo_preview');?> -
-
-
- pictureList->display('head');?> - pictureList->display('list');?> -
-
- -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.2.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; + +/* Define flags */ +$flags = array(); +if (count($lgs = $camyks->get_confValue('editing_languages')) > 1) + foreach ($lgs as $l) + $flags[$l] = ''; +else + foreach ($lgs as $l) + $flags[$l] = ''; + +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header(); ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + + pictureGalleryStatusList[$this->pictureGalleryItem->vars['status']]; ?> +
+ + get_translation('formitem_title'); ?> + + pictureGalleryItem->vars['title_'.$l]; ?> +
+ + get_translation('formitem_summary'); ?> + + pictureGalleryItem->vars['summary_'.$l]; ?> +
+ get_translation('formitem_date'); ?> + + pictureGalleryItem->vars['cdate']); ?> +
+   +
+ theme->get_button(array( + 'title' => $this->get_translation('edit_properties'), + 'url' => $this->get_adminLink(array('mode'=>'edit_pictureGallery', 'pictureGallery_id'=>$this->pictureGalleryItem->id)), + )); ?> +
+
+ +
+
+
+ +
+
+ get_translation('photo_preview'); ?> +
+
+
+ pictureList->display('head'); ?> + pictureList->display('list'); ?> +
+
+ +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_edit.html.inc b/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_edit.html.inc index b7d37f21..88e335c2 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_edit.html.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_edit.html.inc @@ -1,113 +1,115 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0.1 - * Object Type : Plugin / Module Layout - * Creation Date : Jun 2015 - * Last Modif Date : Jul 2018 - * - * Admin_GenericMediaLibraryManager Module Admin Layout : edit_config -*/ -global $camyks; -?> -theme->get_boxHeader(array('class'=>'adminEditorModule'));?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxContent2Header( )?> - -configform->display_header(); ?> -configform->display_hiddens(); ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('picturegalleries');?> -
- get_translation('formitem_maxfilesize');?> - - configform->display_textInput(array('name'=>'picture_maxFileSize', 'maxlength'=>6, 'class'=>'vsinputs'));?> M -
- get_translation('formitem_resizemode');?> - - configform->display_selectInput(array('name'=>'picture_resizeMode', 'values'=>$this->get_configResizeModeList()));?> -
- get_translation('formitem_backgroundcolor');?> - - configform->display_textInput(array('name'=>'picture_backgroundColor', 'maxlength'=>7, 'class'=>'vsinputs'));?> -
- get_translation('formitem_filetype');?> - - configform->display_selectInput(array('name'=>'picture_fileType', 'values'=>$this->get_configFileTypeList()));?> -
- get_translation('formitem_quality');?> - - configform->display_textInput(array('name'=>'picture_jpgQuality', 'maxlength'=>3, 'class'=>'vsinputs'));?> % -
- get_translation('formitem_picturewidth');?> - - configform->display_textInput(array('name'=>'picture_pictureWidth', 'maxlength'=>6, 'class'=>'vsinputs'));?> px -
- get_translation('formitem_pictureheight');?> - - configform->display_textInput(array('name'=>'picture_pictureHeight', 'maxlength'=>6, 'class'=>'vsinputs'));?> px -
- get_translation('formitem_thumbwidth');?> - - configform->display_textInput(array('name'=>'picture_thumbWidth', 'maxlength'=>6, 'class'=>'vsinputs'));?> px -
- get_translation('formitem_thumbheight');?> - - configform->display_textInput(array('name'=>'picture_thumbHeight', 'maxlength'=>6, 'class'=>'vsinputs'));?> px -
-
-configform->display_footer(); ?> - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.2 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxContent2Header( )?> + +configform->display_header(); ?> +configform->display_hiddens(); ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('picturegalleries'); ?> +
+ get_translation('formitem_maxfilesize'); ?> + + configform->display_textInput(array('name'=>'picture_maxFileSize', 'maxlength'=>6, 'class'=>'vsinputs')); ?> M +
+ get_translation('formitem_resizemode'); ?> + + configform->display_selectInput(array('name'=>'picture_resizeMode', 'values'=>$this->get_configResizeModeList())); ?> +
+ get_translation('formitem_backgroundcolor'); ?> + + configform->display_textInput(array('name'=>'picture_backgroundColor', 'maxlength'=>7, 'class'=>'vsinputs')); ?> +
+ get_translation('formitem_filetype'); ?> + + configform->display_selectInput(array('name'=>'picture_fileType', 'values'=>$this->get_configFileTypeList())); ?> +
+ get_translation('formitem_quality'); ?> + + configform->display_textInput(array('name'=>'picture_jpgQuality', 'maxlength'=>3, 'class'=>'vsinputs')); ?> % +
+ get_translation('formitem_picturewidth'); ?> + + configform->display_textInput(array('name'=>'picture_pictureWidth', 'maxlength'=>6, 'class'=>'vsinputs')); ?> px +
+ get_translation('formitem_pictureheight'); ?> + + configform->display_textInput(array('name'=>'picture_pictureHeight', 'maxlength'=>6, 'class'=>'vsinputs')); ?> px +
+ get_translation('formitem_thumbwidth'); ?> + + configform->display_textInput(array('name'=>'picture_thumbWidth', 'maxlength'=>6, 'class'=>'vsinputs')); ?> px +
+ get_translation('formitem_thumbheight'); ?> + + configform->display_textInput(array('name'=>'picture_thumbHeight', 'maxlength'=>6, 'class'=>'vsinputs')); ?> px +
+
+configform->display_footer(); ?> + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_view.html.inc b/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_view.html.inc index 6e407309..6ffededc 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_view.html.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_view.html.inc @@ -1,113 +1,114 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0.1 - * Object Type : Plugin / Module Layout - * Creation Date : Jun 2015 - * Last Modif Date : Jul 2018 - * - * Admin_GenericMediaLibraryManager Module Admin Layout : edit_config -*/ -global $camyks; - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('picturegalleries');?> -
- get_translation('formitem_maxfilesize');?> - - config->vars['picture_maxFileSize']?> M -
- get_translation('formitem_resizemode');?> - - configResizeModeList[$this->config->vars['picture_resizeMode']];?> -
- get_translation('formitem_backgroundcolor');?> - - config->vars['picture_backgroundColor'];?> -
- get_translation('formitem_filetype');?> - - configFileTypeList[$this->config->vars['picture_fileType']];?> -
- get_translation('formitem_quality');?> - - config->vars['picture_jpgQuality'];?> % -
- get_translation('formitem_picturewidth');?> - - config->vars['picture_pictureWidth'];?> px -
- get_translation('formitem_pictureheight');?> - - config->vars['picture_pictureHeight'];?> px -
- get_translation('formitem_thumbwidth');?> - - config->vars['picture_thumbWidth'];?> px -
- get_translation('formitem_thumbheight');?> - - config->vars['picture_thumbHeight'];?> px -
-   -
- theme->get_button(array('url'=>$this->get_adminLink(array('mode'=>'edit_config')), 'title'=>$this->get_translation('edit_config')));?> -
\ No newline at end of file + + * @version 1.0.2 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('picturegalleries'); ?> +
+ get_translation('formitem_maxfilesize'); ?> + + config->vars['picture_maxFileSize']?> M +
+ get_translation('formitem_resizemode'); ?> + + configResizeModeList[$this->config->vars['picture_resizeMode']]; ?> +
+ get_translation('formitem_backgroundcolor'); ?> + + config->vars['picture_backgroundColor']; ?> +
+ get_translation('formitem_filetype'); ?> + + configFileTypeList[$this->config->vars['picture_fileType']]; ?> +
+ get_translation('formitem_quality'); ?> + + config->vars['picture_jpgQuality']; ?> % +
+ get_translation('formitem_picturewidth'); ?> + + config->vars['picture_pictureWidth']; ?> px +
+ get_translation('formitem_pictureheight'); ?> + + config->vars['picture_pictureHeight']; ?> px +
+ get_translation('formitem_thumbwidth'); ?> + + config->vars['picture_thumbWidth']; ?> px +
+ get_translation('formitem_thumbheight'); ?> + + config->vars['picture_thumbHeight']; ?> px +
+   +
+ theme->get_button(array('url'=>$this->get_adminLink(array('mode'=>'edit_config')), 'title'=>$this->get_translation('edit_config'))); ?> +
diff --git a/plugin/module/Admin_GenericMediaLibraryManager/js/PictureList.js b/plugin/module/Admin_GenericMediaLibraryManager/js/PictureList.js index 79f91390..98298bc3 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/js/PictureList.js +++ b/plugin/module/Admin_GenericMediaLibraryManager/js/PictureList.js @@ -1,16 +1,14 @@ -/* - * CaMykS Engine - * Developed by : camyks.net - * Author : CaMykS Team - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Scripts - * Creation Date : Jun 2015 - * Last Modif Date : Jun 2015 - * - * Admin_GenericMediaLibraryManager picture list script +/** + * @brief Admin_GenericMediaLibraryManager module picture list script + * @details Plugin / Module Scripts + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2019 + * @copyright 2015 - 2019 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - function PictureList(name) { this.name = name; this.params = {}; @@ -30,7 +28,7 @@ function PictureList(name) { else this.params[param] = value; }; - + /* * return param value from name * @param mixed param @@ -45,9 +43,9 @@ function PictureList(name) { return this.params[param]; return false; }; - + /* - * set locale value + * set locale value * @param string name * @param string value * @return void @@ -56,9 +54,9 @@ function PictureList(name) { this.set_locale = function(name, value) { this.locales[name.toLowerCase()] = value; }; - + /* - * get locale value + * get locale value * @param string name * @return void * @access public @@ -68,18 +66,18 @@ function PictureList(name) { return this.locales[name.toLowerCase()]; return name; }; - - /* + + /* * initialise object * @return void * @access public */ this.initialise = function() { - + /* finalise initialisation */ this.loaded = true; }; - + /* * display picture preview * @return void @@ -88,12 +86,12 @@ function PictureList(name) { this.display_picturePreview = function(pId) { container = document.getElementById('picturePreview'); container.innerHTML = ''; - + img = document.createElement('img'); img.src = this.get_param('picturesURL', pId); img.alt = ''; img.style.maxWidth = this.get_param('previewMaxWidth')+'px'; - + container.appendChild(img); }; -} \ No newline at end of file +} diff --git a/plugin/module/Admin_GenericMediaLibraryManager/js/PictureSaving.js b/plugin/module/Admin_GenericMediaLibraryManager/js/PictureSaving.js index 202a4506..5917b009 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/js/PictureSaving.js +++ b/plugin/module/Admin_GenericMediaLibraryManager/js/PictureSaving.js @@ -1,16 +1,14 @@ -/* - * CaMykS Engine - * Developed by : camyks.net - * Author : CaMykS Team - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Scripts - * Creation Date : Jun 2015 - * Last Modif Date : Jun 2015 - * - * Admin_GenericMediaLibraryManager picture saving script +/** + * @brief Admin_GenericMediaLibraryManager module picture saving script + * @details Plugin / Module Scripts + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2019 + * @copyright 2015 - 2019 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - function PictureSaving(name) { this.name = name; this.params = {}; @@ -30,7 +28,7 @@ function PictureSaving(name) { else this.params[param] = value; }; - + /* * return param value from name * @param mixed param @@ -44,9 +42,9 @@ function PictureSaving(name) { return this.params[param] return false; }; - + /* - * set locale value + * set locale value * @param string name * @param string value * @return void @@ -55,9 +53,9 @@ function PictureSaving(name) { this.set_locale = function(name, value) { this.locales[name.toLowerCase()] = value; }; - + /* - * get locale value + * get locale value * @param string name * @return void * @access public @@ -67,8 +65,8 @@ function PictureSaving(name) { return this.locales[name.toLowerCase()]; return name; }; - - /* + + /* * initialise object * @return void * @access public @@ -76,32 +74,32 @@ function PictureSaving(name) { this.initialise = function() { /* check navigator type */ this.set_param('navType', navigator.appName.indexOf("Microsoft")==-1? 'real':'msie'); - + /* save form object */ this.set_param('adminMessage', document.getElementById('adminMessage')); - + /* init ajax request engine */ this.loader = new CAjaxRequest(this.name+'.loader'); this.loader._initialise(null, 'POST', this.name+'._receiveRequestResult', 'xml', this.name+'._receiveRequestError'); - + /* initialise request queue */ this.requestQueue = new Array(); /* send main picture saving request */ this._executeRequest(this.get_param('requestBaseURL')+'&mode=optimisePictureImage&picture_id='+this.get_param('pictureId')); }; - + /* - * quit + * quit * @return void * @access public */ this.quit = function() { document.location.href = this.get_param('backURL'); } - + /* request methods */ - + /* * execute request * @param string url @@ -124,18 +122,18 @@ function PictureSaving(name) { * @return void * @access private */ - this._receiveRequestResult = function(result) { + this._receiveRequestResult = function(result) { /* decompile result */ result = xml_serializeObject(result); - + /* check result : if result is undefined, what to do ? */ if ( result == null ) return; - + /* get errors or messages */ if ( result['status'] == 'failure' ) alert(result['message']); - + /* check action result */ switch (result['action']) { case 'optimisePictureImage': @@ -149,14 +147,14 @@ function PictureSaving(name) { setTimeout(this.name+'.quit();', this.get_param('quitDelay')*1000); break; } - + /* try to reduce request queue */ if ( this.requestQueue.length > 0 ) { request = this.requestQueue.shift(); this._executeRequest(request[0], request[1], true); } }; - + /* * receive request error * @param xml result @@ -166,4 +164,4 @@ function PictureSaving(name) { this._receiveRequestError = function() { /* define what to do */ }; -} \ No newline at end of file +} diff --git a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerConfig.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerConfig.php.inc index 6dd62419..2d4354dc 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerConfig.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerConfig.php.inc @@ -1,63 +1,68 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Config - * Creation Date : Jun 2015 - * Last Modif Date : Jun 2015 - * - * Admin_GenericMediaLibraryManagerConfig Object +/** + * @brief Admin_GenericMediaLibraryManager Module configuration library + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -class Admin_GenericMediaLibraryManagerConfig extends ModuleConfig { - /* - * constructor - * @param string $name - * @param Module $parent - */ - function Admin_GenericMediaLibraryManagerConfig ( $name, &$parent ) { - parent::ModuleConfig( $name, $parent ); +/** + * Admin_GenericMediaLibraryManagerConfig class. + */ +final class Admin_GenericMediaLibraryManagerConfig extends PluginConfig { + /** + * Class constructor. + * @param string $name + * @param Module $parent + * @return void + */ + public function __construct($name, &$parent) { + parent::__construct($name, $parent); + + /* Configuration attributes */ + $this->add_newItem('picture_maxFileSize', 'float', 8); + $this->add_newItem('picture_resizeMode', 'integer', 0); + $this->add_newItem('picture_backgroundColor', 'string', '#FFFFFF'); + $this->add_newItem('picture_fileType', 'integer', 0); + $this->add_newItem('picture_jpgQuality', 'integer', 70); + $this->add_newItem('picture_pictureWidth', 'int', 800); + $this->add_newItem('picture_pictureHeight', 'int', 600); + $this->add_newItem('picture_thumbWidth', 'int', 120); + $this->add_newItem('picture_thumbHeight', 'int', 100); + + /* Perform generic initialisation */ + parent::init_config(); + } + + /* specific tool methods */ - /* config items */ - $this->add_newItem('picture_maxFileSize', 'float', 8 ); - $this->add_newItem('picture_resizeMode', 'integer', 0); - $this->add_newItem('picture_backgroundColor', 'string', '#FFFFFF'); - $this->add_newItem('picture_fileType', 'integer', 0); - $this->add_newItem('picture_jpgQuality', 'integer', 70); - $this->add_newItem('picture_pictureWidth', 'int', 800 ); - $this->add_newItem('picture_pictureHeight', 'int', 600 ); - $this->add_newItem('picture_thumbWidth', 'int', 120 ); - $this->add_newItem('picture_thumbHeight', 'int', 100 ); + /** + * Return resize mode list. + * @return array + */ + public function get_resizeModeList() { + return array( + 0 => $this->get_translation('pictureresizemode_fixedsize'), + 1 => $this->get_translation('pictureresizemode_maxsize'), + ); + } - /* generic initialisation */ - parent::init_config(); - } - - /* specific tool methods */ - - /* - * return resize mode list - * @return array - * @access parent - */ - function get_resizeModeList() { - return array(0 => $this->get_translation('pictureresizemode_fixedsize'), - 1 => $this->get_translation('pictureresizemode_maxsize')); - } - - /* - * return image type value list - * @return array - * @access private - */ - function get_fileTypeList() { - return array(0 => $this->get_translation('imagefiletype_original'), - 1 => $this->get_translation('imagefiletype_forcedtojpg'), - 2 => $this->get_translation('imagefiletype_forcedtogif'), - 3 => $this->get_translation('imagefiletype_forcedtopng'),); - } + /** + * Return image type value list. + * @return array + */ + public function get_fileTypeList() { + return array( + 0 => $this->get_translation('imagefiletype_original'), + 1 => $this->get_translation('imagefiletype_forcedtojpg'), + 2 => $this->get_translation('imagefiletype_forcedtogif'), + 3 => $this->get_translation('imagefiletype_forcedtopng'), + ); + } } -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPicture.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPicture.php.inc index 272ca05f..b2f894f6 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPicture.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPicture.php.inc @@ -1,586 +1,560 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Jun 2015 - * Last Modif Date : Nov 2017 - * - * Admin_GenericMediaLibraryManagerPicture object for Admin_GenericMediaLibraryManager Module - */ - -class Admin_GenericMediaLibraryManagerPicture extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericMediaLibraryManagerPicture ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - - /* content items */ - $this->add_newItem('gallery', 'db', 'int', 'int unsigned', '', 0); - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('sortPosition', 'db', 'int', 'smallint unsigned', '', 0); - $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); - $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); - - /* file items */ - $this->add_newItem('original', 'file', 'originals', '', '', ''); - $this->add_newItem('picture', 'file', 'pictures', '', '', ''); - $this->add_newItem('thumb', 'file', 'thumbs', '', '', ''); - - /* define pictures & thumbs folders */ - $this->foldersUpdated = false; - $this->autoDisabled = false; - $this->update_imageFolders(); - $this->isNew = false; - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary method */ - - /* - * check object data - * @return boolean result - * @access public - */ - function check_data() { - - /* check for auto disable picture object without a picture file */ - if (!$this->_libItems['original']->upload) { - if ($this->id == 0) { - $this->_libItems['status']->value = 0; - $this->autoDisabled = true; - } - else { - $obj = $this->get_newObject($this->id); - $obj->get(); - $obj->get_fromItems(); - if ($obj->vars['original'] == '') { - $this->_libItems['status']->value = 0; - $this->autoDisabled = true; - } - } - } - - /* check for position */ - if ($this->id == 0) { - $this->_libItems['sortPosition']->value = $this->get_newPosition(); - $this->isNew = true; - } - return true; - } - - /* - * save object - * @return boolean success - * @access private - */ - function save() { - /* check data validity */ - if ( $this->check_data() ) { - return $this->save_databaseItems() - and $this->save_databaseLocalisedItems() - and $this->update_imageFolders() - and $this->save_textItems() - and $this->save_fileItems() - and $this->check_forGalleryDefaultPicture(); - } - return false; - } - - /* - * get file items - * @param string $language - * @return boolean result - * @access private - */ - function get_fileItems($language=null) { - return $this->update_imageFolders() and parent::get_fileItems(); - } - - /* - * build sql condition for lists - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition($params) { - $search = array(); - if ( isset( $params['status'] ) and $params['status'] > -1 ) - $search[] = 'status='.$params['status']; - if ( isset( $params['gallery'] ) and $params['gallery'] > -1 ) - $search[] = 'gallery='.$params['gallery']; - return implode(',', $search); - } - - /* specific tool methods */ - - /* - * return single object status list - * @return array - * @access private - */ - function get_statusList() { - return array(0 => $this->get_translation('picturestatus_inactive'), - 1 => $this->get_translation('picturestatus_active'), - ); - } - - /* - * return multi object status list - * @param boolean $full - * @return array - * @access private - */ - function get_multiStatusList($full=false) { - $list = array(); - if ($full) - $list['-1'] = $this->get_translation('pictures_all'); - $list['0'] = $this->get_translation('picturesstatus_inactive'); - $list['1'] = $this->get_translation('picturesstatus_active'); - return $list; - } - - /* - * load config value - * @param string $param - * @return mixed - * @access private - */ - function get_configValue($param='') { - return $this->_libParent->get_configValue($param); - } - - /* - * update image folders - * @return boolean success - * @access private - */ - function update_imageFolders() { - if ($this->foldersUpdated) return true; - - if ($this->_libItems['gallery']->value > 0 ) { - $basePath = 'PictureGallery'.$this->_libItems['gallery']->value; - $this->_libItems['original']->folder = $basePath.'/'.$this->_libItems['original']->folder; - $this->_libItems['picture']->folder = $basePath.'/'.$this->_libItems['picture']->folder; - $this->_libItems['thumb']->folder = $basePath.'/'.$this->_libItems['thumb']->folder; - - $this->foldersUpdated = true; - } - return true; - } - - /* - * get document count by categories - * @param array $categories - * @return array - * @access public - */ - function get_pictureCountByGalleries($galleries=null) { - - $list = array(); - /* check categories */ - if ( is_array($galleries) and count($galleries) == 0) - return $list; - - /* build sql query */ - $sql = 'select gallery, count(id) as cnt from '.$this->_libSQLTable; - if ( is_array($galleries) and count($galleries)>0 ) { - $sql .= ' where gallery in ('.implode(',', $galleries).')'; - } - $sql .= ' group by gallery'; - - /* execute sql query */ - if ( $this->execute_DBQuery($sql, __LINE__ )) - /* get data from database */ - while ( $data = $this->get_DBQueryDataLine()) - $list[$data['gallery']] = $data['cnt']; - - /* send results */ - return $list; - } - - /* - * check parent gallery for picture as default one - * @return true - * @access private - */ - function check_forGalleryDefaultPicture() { - $this->get_fromItems(); - - if ($this->isNew == false or $this->vars['status']==0 or $this->vars['gallery']==0) - return true; - - $gallery = &$this->_libParent->pictureGalleryItem; - $gallery->id = $this->vars['gallery']; - $gallery->get(); - $gallery->get_fromItems(); - $gallery->check_forDefaultPicture($this->id); - return true; - } - - /* - * optimise picture - * @return - * @access private - */ - function optimise_picture() { - /* delete old one */ - $this->_libItems['picture']->delete($this->id); - - /* create image path */ - $pictPath = $this->_libItems['picture']->path . '/' . $this->_libItems['picture']->folder; - folder_completePath($pictPath); - - /* create virtual image */ - $img = new CImage($this->vars['original']); - $img->update_JPGQuality($this->get_configValue('picture_jpgQuality')); - - $w = $this->get_configValue('picture_pictureWidth'); - $h = $this->get_configValue('picture_pictureHeight'); - - if ( $this->get_configValue('picture_resizeMode') == 0) { - if ($img->width >= $img->height) { - /* resize and crop to exact size horizontal picture */ - $img->resize($w, $h, 1); - $img->crop($w, $h, '', $this->get_configValue('picture_backgroundColor')); - $img->sharp(); - } else { - /* resize and crop to exact size vertical picture */ - $img->resize($w, $h, 2); - $img->crop($w, $h, '', $this->get_configValue('picture_backgroundColor')); - $img->sharp(); - } - } else { - if ($img->width <= $this->get_configValue('picture_pictureWidth') - and $img->height <= $this->get_configValue('picture_pictureHeight')) { - /* picture is smaller than final size : do nothing */ - - } else { - /* resize and crop to max size */ - $img->resize($w, $h, 2); - $img->sharp(); - } - } - - return $img->save_image($pictPath.'/picture'.$this->id, $this->get_fileTypeValue()); - } - - /* - * optimise thumb - * @return CRequestAnswer object - * @access private - */ - function optimise_thumb() { - /* delete old one */ - $this->_libItems['thumb']->delete($this->id); - - /* create image path */ - $thumbPath = $this->_libItems['thumb']->path . '/' . $this->_libItems['thumb']->folder; - folder_completePath($thumbPath); - - /* create virtual image */ - $img = new CImage($this->vars['original']); - $img->update_JPGQuality($this->get_configValue('picture_jpgQuality')); - - $w = $this->get_configValue('picture_thumbWidth'); - $h = $this->get_configValue('picture_thumbHeight'); - - $img->resize($w, $h, 1); - $img->crop($w, $h); - $img->sharp(); - - return $img->save_image($thumbPath.'/thumb'.$this->id, $this->get_fileTypeValue()); - } - - /* - * check if image object has a new original picture - * @return boolean result - * @access public - */ - function has_newPicture() { - return ($this->_libItems['original']->upload); - } - - /* - * return image type value - * @return string - * @access private - */ - function get_fileTypeValue() { - $l = array(0 => '', 1=>'jpg', 2=>'gif', 4=>'png'); - return $l[$this->get_configValue('images_fileType')]; - } - - /* - * check if picture is default picture - * @return boolean result - * @access private - */ - function is_defaultPicture() { - if ($this->_libParent->pictureGalleryItem->id == $this->vars['gallery']) - return ($this->_libParent->pictureGalleryItem->vars['defaultPicture'] == $this->id); - return false; - } - - /* - * return picture radio button to select default picture - * @return boolean result - * @access private - */ - function get_isDefaultIconRadio() { - return 'is_defaultPicture()?' checked="checked"':'').($this->vars['status']==0?' disabled="disabled"':'').' />'; - } - - /* - * return icon indicating if picture is default picture - * @return boolean result - * @access private - */ - function get_isDefaultPictureIcon() { - if ($this->is_defaultPicture()) - return ''.$this->get_translation('ismainimage').''; - return ''.$this->get_translation('isnotmainimage').''; - } - - /* - * return object list - * @param array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - - /* default params list */ - $dParams = array('status'=>-1, 'gallery'=>-1, 'galleries'=>-1, 'ids'=>-1, 'language'=>$camyks->current_language, - 'limit'=>-1, 'count'=>-1, 'order'=>'sortPosition', 'orderway'=>'asc'); - - /* merge params */ - $params = array_merge($dParams, $params); - - /* build where statement */ - $w = $this->build_whereStatement($params); - - /* return list */ - return $this->get_objectList($params['language'], $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); - } - - /* - * return first object list for given galleries - * @param array $params - * @return array - * @access private - */ - function get_firstList($params=array()) { - global $camyks; - - /* default params list */ - $dParams = array('status'=>-1, 'gallery'=>-1, 'galleries'=>-1, 'ids'=>-1, 'language'=>$camyks->current_language, - 'limit'=>-1, 'count'=>-1, 'order'=>'sortPosition', 'orderway'=>'asc'); - - /* merge params */ - $params = array_merge($dParams, $params); - - /* check galleries */ - if ($params['galleries']==-1 or count($params['galleries']) == 0) - return array(); - - /* build where statement */ - $w = $this->build_whereStatement($params); - - /* build sql query */ - $sql = 'select id, gallery from '.$this->_libSQLTable; - $sql .= ' where '.$w; - $sql .= ' group by gallery'; - $sql .= ' order by sortPosition asc'; - - /* execute sql query */ - $idList = array(); - if ($this->execute_DBQuery($sql, __LINE__ )) - while ($data = $this->get_DBQueryDataLine()) - $idList[] = $data['id']; - - /* return list */ - return $this->get_list(array('ids'=>$idList, 'language'=>$params['language'])); - } - - /* - * return product count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('status'=>-1, 'gallery'=>-1, 'ids'=>-1); - $params = array_merge($p, $params); - $where = $this->build_whereStatement($params); - - return $this->get_objectCount($where); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - - /* check status */ - if ($params['status'] != -1) - $w[] = 'status = '.$params['status'].''; - - /* check gallery / galleries */ - if ($params['galleries'] != -1) { - if (is_array($params['galleries'])) { - switch (count($params['galleries'])) { - case 0: return 'false'; break; - case 1: - foreach ($params['galleries'] as $id) - $w[] = 'gallery = '.$id; - break; - default: - $w[] = 'gallery in ('.implode(',', $params['galleries']).')'; - } - } else - return 'false'; - } elseif ($params['gallery'] != -1) - $w[] = 'gallery = '.$params['gallery']; - - /* check picture ids */ - if ($params['ids'] != -1 and $params['ids'] != '') { - if (is_string($params['ids'])) - $params['ids'] = explode(',', $params['ids']); - - if (is_array($params['ids'])) { - if( count($params['ids']) == 0) { - $w[] = 'false'; - } elseif (count($params['ids']) == 1) { - $w[] = 'id = '.$params['ids'][0]; - } else { - $w[] = 'id in ('.implode(',', $params['ids']).')'; - } - } - } - - /* return result */ - return implode(' and ', $w); - } - - /* sort position management methods */ - - /* - * get object new position - * @return integer - * @access private - */ - function get_newPosition() { - /* build sql */ - $sql = 'select sortPosition'; - $sql .= ' from '.$this->_libSQLTable; - $sql .= ' where gallery='.$this->_libItems['gallery']->value; - $sql .= ' order by sortPosition desc limit 1'; - - /* execute sql query */ - if ($this->execute_DBQuery($sql, __LINE__ )) - if ($data = $this->get_DBQueryDataLine()) - return $data['sortPosition']+1; - return 0; - } - - /* - * is not first - * @return boolean result - * @access private - */ - function is_notFirst() { - return $this->vars['sortPosition'] > 0; - } - - /* - * is not last - * @return boolean result - * @access private - */ - function is_notLast() { - if (!isset($this->_libParent->pictureList)) - return false; - return $this->vars['sortPosition'] < $this->_libParent->pictureList->objectCount-1; - } - - /* - * update page position to upper - * @return boolean success - * @access public - */ - function update_moveUp() { - return $this->update_movePosition(-1); - } - - /* - * update page position to lower - * @return boolean success - * @access public - */ - function update_moveDown() { - return $this->update_movePosition(1); - } - - /* - * update page position - * @param integer $pos - * @return boolean success - * @access public - */ - function update_movePosition($pos) { - global $camyks; - - /* get all parent pages */ - $sql = 'select id, sortPosition'; - $sql .= ' from '.$this->_libSQLTable; - $sql .= ' where gallery='.$this->_libItems['gallery']->value; - $sql .= ' order by sortPosition'; - if ( !$this->execute_DBQuery($sql, __LINE__ )) - return false; - - $items = array(); - $position = -1; - while ($data = $this->get_DBQueryDataLine()) { - if ( $data['id'] == $this->id ) - $position = count($items); - $items[] = $data; - } - - /* check new position value */ - if ( $position == -1 or ($position+$pos<0) or $position+$pos>=count($items)) - return false; - - /* update position */ - $temp = $items[$position]; - $items[$position] = $items[$position+$pos]; - $items[$position+$pos] = $temp; - - /* update all pages which the position is not correct */ - foreach ($items as $index => $item ) { - if ( $index != $item['sortPosition'] ) { - $sql = 'update '.$this->_libSQLTable; - $sql .= ' set sortPosition='.$index; - $sql .= ' where id='.$item['id']; - if ( !$this->execute_DBQuery($sql, __LINE__ )) - return false; - } - } - return true; - } -} -?> \ No newline at end of file + + * @version 1.0.1.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericMediaLibraryManagerPicture class. + */ +final class Admin_GenericMediaLibraryManagerPicture extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Content attributes */ + $this->add_newItem('gallery', 'db', 'int', 'int unsigned', '', 0); + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('sortPosition', 'db', 'int', 'smallint unsigned', '', 0); + $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); + $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); + + /* File items */ + $this->add_newItem('original', 'file', 'originals', '', '', ''); + $this->add_newItem('picture', 'file', 'pictures', '', '', ''); + $this->add_newItem('thumb', 'file', 'thumbs', '', '', ''); + + /* Define pictures & thumbs folders */ + $this->foldersUpdated = false; + $this->autoDisabled = false; + $this->update_imageFolders(); + $this->isNew = false; + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary method */ + + /** + * Check object data. + * @return boolean result + */ + public function check_data() { + /* Check for auto disable picture object without a picture file */ + if (!$this->_libItems['original']->upload) { + if ($this->id == 0) { + $this->_libItems['status']->value = 0; + $this->autoDisabled = true; + } else { + $obj = $this->get_newObject($this->id); + $obj->get(); + $obj->get_fromItems(); + if ($obj->vars['original'] == '') { + $this->_libItems['status']->value = 0; + $this->autoDisabled = true; + } + } + } + + /* Check for position */ + if ($this->id == 0) { + $this->_libItems['sortPosition']->value = $this->get_newPosition(); + $this->isNew = true; + } + return true; + } + + /** + * Save object. + * @return boolean success + */ + public function save() { + /* Check data validity */ + if ($this->check_data()) { + return $this->save_databaseItems() + and $this->save_databaseLocalisedItems() + and $this->update_imageFolders() + and $this->save_textItems() + and $this->save_fileItems() + and $this->check_forGalleryDefaultPicture(); + } + return false; + } + + /** + * Load file items. + * @param string $language + * @return boolean result + */ + public function get_fileItems($language=null) { + return $this->update_imageFolders() and parent::get_fileItems(); + } + + /** + * Build sql condition for lists. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + $search = array(); + if (isset($params['status']) and $params['status'] > -1) + $search[] = 'status='.$params['status']; + if (isset($params['gallery']) and $params['gallery'] > -1) + $search[] = 'gallery='.$params['gallery']; + return implode(',', $search); + } + + /* Specific tool methods */ + + /** + * Return single object status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('picturestatus_inactive'), + 1 => $this->get_translation('picturestatus_active'), + ); + } + + /** + * Return multi object status list. + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if ($full) + $list['-1'] = $this->get_translation('pictures_all'); + $list['0'] = $this->get_translation('picturesstatus_inactive'); + $list['1'] = $this->get_translation('picturesstatus_active'); + return $list; + } + + /** + * Return config value. + * @param string $param + * @return mixed + */ + private function get_configValue($param) { + return $this->_libParent->get_configValue($param); + } + + /** + * Update image folders. + * @return boolean success + */ + private function update_imageFolders() { + if ($this->foldersUpdated) return true; + + if ($this->_libItems['gallery']->value > 0) { + $basePath = 'PictureGallery'.$this->_libItems['gallery']->value; + $this->_libItems['original']->folder = $basePath.'/'.$this->_libItems['original']->folder; + $this->_libItems['picture']->folder = $basePath.'/'.$this->_libItems['picture']->folder; + $this->_libItems['thumb']->folder = $basePath.'/'.$this->_libItems['thumb']->folder; + + $this->foldersUpdated = true; + } + return true; + } + + /** + * Return pictures count by categories + * @param array $galleries + * @return array + */ + public function get_pictureCountByGalleries($galleries=null) { + + $list = array(); + + /* Check categories */ + if (is_array($galleries) and count($galleries) == 0) + return $list; + + /* Build sql query */ + $sql = 'select gallery, count(id) as cnt from '.$this->_libSQLTable; + if ( is_array($galleries) and count($galleries)>0) { + $sql .= ' where gallery in ('.implode(',', $galleries).')'; + } + $sql .= ' group by gallery'; + + /* Execute sql query */ + if ($this->execute_DBQuery($sql, __LINE__)) + /* Load data from database */ + while ($data = $this->get_DBQueryDataLine()) + $list[$data['gallery']] = $data['cnt']; + + /* Send results */ + return $list; + } + + /** + * Check parent gallery for picture as default one. + * @return true + */ + public function check_forGalleryDefaultPicture() { + $this->get_fromItems(); + + if ($this->isNew == false or $this->vars['status'] == 0 or $this->vars['gallery'] == 0) + return true; + + $gallery = &$this->_libParent->pictureGalleryItem; + $gallery->id = $this->vars['gallery']; + $gallery->get(); + $gallery->get_fromItems(); + $gallery->check_forDefaultPicture($this->id); + return true; + } + + /** + * Optimise picture. + * @return boolean result. + */ + public function optimise_picture() { + /* delete old one */ + $this->_libItems['picture']->delete($this->id); + + /* Create image path */ + $pictPath = $this->_libItems['picture']->path . '/' . $this->_libItems['picture']->folder; + folder_completePath($pictPath); + + /* Create virtual image */ + $img = new CImage($this->vars['original']); + $img->update_JPGQuality($this->get_configValue('picture_jpgQuality')); + + $w = $this->get_configValue('picture_pictureWidth'); + $h = $this->get_configValue('picture_pictureHeight'); + + if ($this->get_configValue('picture_resizeMode') == 0) { + if ($img->width >= $img->height) { + /* Resize and crop to exact size horizontal picture */ + $img->resize($w, $h, 1); + $img->crop($w, $h, '', $this->get_configValue('picture_backgroundColor')); + $img->sharp(); + } else { + /* Resize and crop to exact size vertical picture */ + $img->resize($w, $h, 2); + $img->crop($w, $h, '', $this->get_configValue('picture_backgroundColor')); + $img->sharp(); + } + } else { + if ($img->width <= $this->get_configValue('picture_pictureWidth') + and $img->height <= $this->get_configValue('picture_pictureHeight')) { + /* picture is smaller than final size : do nothing */ + + } else { + /* Resize and crop to max size */ + $img->resize($w, $h, 2); + $img->sharp(); + } + } + + return $img->save_image($pictPath.'/picture'.$this->id, $this->get_fileTypeValue()); + } + + /** + * Optimise thumb. + * @return boolean success + */ + public function optimise_thumb() { + /* delete old one */ + $this->_libItems['thumb']->delete($this->id); + + /* Create image path */ + $thumbPath = $this->_libItems['thumb']->path . '/' . $this->_libItems['thumb']->folder; + folder_completePath($thumbPath); + + /* Create virtual image */ + $img = new CImage($this->vars['original']); + $img->update_JPGQuality($this->get_configValue('picture_jpgQuality')); + + $w = $this->get_configValue('picture_thumbWidth'); + $h = $this->get_configValue('picture_thumbHeight'); + + $img->resize($w, $h, 1); + $img->crop($w, $h); + $img->sharp(); + + return $img->save_image($thumbPath.'/thumb'.$this->id, $this->get_fileTypeValue()); + } + + /** + * Check if image object has a new original picture. + * @return boolean result + */ + public function has_newPicture() { + return ($this->_libItems['original']->upload); + } + + /** + * Return image type value. + * @return string + */ + public function get_fileTypeValue() { + $l = array(0 => '', 1=>'jpg', 2=>'gif', 4=>'png'); + return $l[$this->get_configValue('images_fileType')]; + } + + /** + * Check if picture is default picture. + * @return boolean result + */ + public function is_defaultPicture() { + if ($this->_libParent->pictureGalleryItem->id == $this->vars['gallery']) + return ($this->_libParent->pictureGalleryItem->vars['defaultPicture'] == $this->id); + return false; + } + + /** + * Return picture radio button to select default picture. + * @return boolean result + */ + public function get_isDefaultIconRadio() { + return 'is_defaultPicture() ? ' checked="checked"' : '').($this->vars['status']==0 ? ' disabled="disabled"' : '').' />'; + } + + /** + * Return icon indicating if picture is default picture. + * @return boolean result + */ + public function get_isDefaultPictureIcon() { + if ($this->is_defaultPicture()) + return ''.$this->get_translation('ismainimage').''; + return ''.$this->get_translation('isnotmainimage').''; + } + + /** + * Return object list. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + + /* Build default params list */ + $dParams = array('status'=>-1, 'gallery'=>-1, 'galleries'=>-1, 'ids'=>-1, 'language'=>$camyks->current_language, 'limit'=>-1, 'count'=>-1, 'order'=>'sortPosition', 'orderway'=>'asc'); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Build where statement */ + $where = $this->build_whereStatement($params); + + /* Return list */ + return $this->get_objectList($params['language'], $where, $params['limit'], $params['count'], $params['order'], $params['orderway']); + } + + /** + * Return first object list for given galleries. + * @param array $params + * @return array + */ + public function get_firstList($params=array()) { + global $camyks; + + /* Build default params list */ + $dParams = array('status'=>-1, 'gallery'=>-1, 'galleries'=>-1, 'ids'=>-1, 'language'=>$camyks->current_language, 'limit'=>-1, 'count'=>-1, 'order'=>'sortPosition', 'orderway'=>'asc'); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Check galleries */ + if ($params['galleries']==-1 or count($params['galleries']) == 0) + return array(); + + /* Build where statement */ + $w = $this->build_whereStatement($params); + + /* Build sql query */ + $sql = 'select id, gallery from '.$this->_libSQLTable; + $sql .= ' where '.$w; + $sql .= ' group by gallery'; + $sql .= ' order by sortPosition asc'; + + /* Execute sql query */ + $idList = array(); + if ($this->execute_DBQuery($sql, __LINE__)) + while ($data = $this->get_DBQueryDataLine()) + $idList[] = $data['id']; + + /* Return list */ + return $this->get_list(array('ids'=>$idList, 'language'=>$params['language'])); + } + + /** + * Return product count with given params. + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + $p = array('status'=>-1, 'gallery'=>-1, 'ids'=>-1); + $params = array_merge($p, $params); + $where = $this->build_whereStatement($params); + + return $this->get_objectCount($where); + } + + /** + * Build where statement from params. + * @param array $params + * @return string + */ + private function build_whereStatement($params=array()) { + $w = array(); + + /* Check status */ + if ($params['status'] != -1) + $w[] = 'status = '.$params['status'].''; + + /* Check gallery / galleries */ + if ($params['galleries'] != -1) { + if (is_array($params['galleries'])) { + switch (count($params['galleries'])) { + case 0: return 'false'; break; + case 1: + foreach ($params['galleries'] as $id) + $w[] = 'gallery = '.$id; + break; + default: + $w[] = 'gallery in ('.implode(',', $params['galleries']).')'; + } + } else + return 'false'; + } elseif ($params['gallery'] != -1) + $w[] = 'gallery = '.$params['gallery']; + + /* Check picture ids */ + if ($params['ids'] != -1 and $params['ids'] != '') { + if (is_string($params['ids'])) + $params['ids'] = explode(',', $params['ids']); + + if (is_array($params['ids'])) { + if(count($params['ids']) == 0) { + $w[] = 'false'; + } elseif (count($params['ids']) == 1) { + $w[] = 'id = '.$params['ids'][0]; + } else { + $w[] = 'id in ('.implode(',', $params['ids']).')'; + } + } + } + + /* Return result */ + return implode(' and ', $w); + } + + /* Sort position management methods */ + + /** + * Return object new position. + * @return integer + */ + private function get_newPosition() { + /* Build sql */ + $sql = 'select sortPosition'; + $sql .= ' from '.$this->_libSQLTable; + $sql .= ' where gallery='.$this->_libItems['gallery']->value; + $sql .= ' order by sortPosition desc limit 1'; + + /* Execute sql query */ + if ($this->execute_DBQuery($sql, __LINE__)) + if ($data = $this->get_DBQueryDataLine()) + return $data['sortPosition']+1; + return 0; + } + + /** + * Check is not first. + * @return boolean result + */ + public function is_notFirst() { + return $this->vars['sortPosition'] > 0; + } + + /** + * Check is not last. + * @return boolean result + */ + public function is_notLast() { + if (!isset($this->_libParent->pictureList)) + return false; + return $this->vars['sortPosition'] < $this->_libParent->pictureList->objectCount-1; + } + + /** + * Update page position to upper. + * @return boolean success + */ + public function update_moveUp() { + return $this->update_movePosition(-1); + } + + /** + * Update page position to lower. + * @return boolean success + */ + public function update_moveDown() { + return $this->update_movePosition(1); + } + + /** + * Update page position. + * @param integer $pos + * @return boolean success + */ + public function update_movePosition($pos) { + global $camyks; + + /* Load all parent pages */ + $sql = 'select id, sortPosition'; + $sql .= ' from '.$this->_libSQLTable; + $sql .= ' where gallery='.$this->_libItems['gallery']->value; + $sql .= ' order by sortPosition'; + if (!$this->execute_DBQuery($sql, __LINE__)) + return false; + + $items = array(); + $position = -1; + while ($data = $this->get_DBQueryDataLine()) { + if ($data['id'] == $this->id) + $position = count($items); + $items[] = $data; + } + + /* Check new position value */ + if ($position == -1 or ($position+$pos<0) or $position+$pos>=count($items)) + return false; + + /* Update position */ + $temp = $items[$position]; + $items[$position] = $items[$position+$pos]; + $items[$position+$pos] = $temp; + + /* Update all pages which the position is not correct */ + foreach ($items as $index => $item) { + if ($index != $item['sortPosition']) { + $sql = 'update '.$this->_libSQLTable; + $sql .= ' set sortPosition='.$index; + $sql .= ' where id='.$item['id']; + if (!$this->execute_DBQuery($sql, __LINE__)) + return false; + } + } + return true; + } +} +?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGallery.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGallery.php.inc index 369bbef3..4b94bba1 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGallery.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGallery.php.inc @@ -1,310 +1,306 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Jun 2015 - * Last Modif Date : Nov 2017 - * - * Admin_GenericMediaLibraryManagerPictureGallery object for Admin_GenericMediaLibraryManager Module - */ - -class Admin_GenericMediaLibraryManagerPictureGallery extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericMediaLibraryManagerPictureGallery ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - - /* main items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); - $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); - $this->add_newItem('summary', 'db', 'text', 'text', '', '', true); - $this->add_newItem('content', 'db', 'text', 'text', '', '', true); - - /* to do items */ - $this->add_newItem('defaultPicture', 'db', 'int', 'bigint unsigned', '', 0); - - /* temp items */ - $this->add_newItem('pictures', 'temp', 'int', '', '', 0); - $this->add_newItem('defaultThumb', 'temp', 'text', '', '', ''); - - /* init picture list */ - $this->pictures = array(); - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary methods */ - - /* - * build sql condition for lists - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition($params) { - if ( isset( $params['status'] ) and $params['status'] > -1 ) - return 'status='.$params['status']; - return ''; - } - - /* - * delete - * @return boolean success - * @access private - */ - function delete() { - /* delete objects */ - if (!parent::delete()) - return false; - - /* delete pictures files */ - - /* delete pictures db entries */ - - /* return result */ - return true; - } - - /* specific tool methods */ - - /* - * return single object status list - * @return array - * @access private - */ - function get_statusList() { - return array(0 => $this->get_translation('picturegallerystatus_inactive'), - 1 => $this->get_translation('picturegallerystatus_public'), - 2 => $this->get_translation('picturegallerystatus_private'), - ); - } - - /* - * return multi object status list - * @param boolean $full - * @return array - * @access private - */ - function get_multiStatusList($full=false) { - $list = array(); - if ($full) - $list['-1'] = $this->get_translation('picturegalleries_all'); - $list['0'] = $this->get_translation('picturegalleriesstatus_inactive'); - $list['1'] = $this->get_translation('picturegalleriesstatus_public'); - $list['2'] = $this->get_translation('picturegalleriesstatus_private'); - return $list; - } - - /* - * return single object status list - * @return array - * @access private - */ - function get_statusIconList() { - return array(0 => ''.$this->get_translation('picturegallerystatus_inactive').'', - 1 => ''.$this->get_translation('picturegallerystatus_public').'', - 2 => ''.$this->get_translation('picturegallerystatus_private').'', - ); - } - - /* - * return object list - * @param array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - - /* default params list */ - $dParams = array('status'=>-1, 'ids'=>-1, 'language'=>$camyks->current_language, - 'load_pictures'=>0, 'load_defaultThumb'=>0, - 'limit'=>-1, 'count'=>-1, 'order'=>'cdate', 'orderway'=>'desc'); - - /* merge params */ - $params = array_merge($dParams, $params); - - /* build where statement */ - $w = $this->build_whereStatement($params); - - /* load list */ - $list = $this->get_objectList($params['language'], $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); - - /* check for load pictures option */ - if ( $params['load_pictures'] > 0 ) { - $galleryIds = array(); - foreach ($list as $gallery) - $galleryIds[] = $gallery->id; - $pictures = $this->get_pictures(array('galleries'=>$galleryIds, 'status'=>$params['status']==-1?-1:1)); - foreach ($pictures as $picture) { - if (!isset($list[$picture->vars['gallery']])) - continue; - $list[$picture->vars['gallery']]->pictures[$picture->id] = &$picture; - } - } - - /* check for load default thumb option */ - if ( $params['load_defaultThumb'] > 0 ) { - if ($params['load_pictures'] > 0) { - /* search thumbs in loaded pictures */ - foreach ($list as &$gallery) { - if (isset($gallery->pictures[$gallery->vars['defaultPicture']])) - $gallery->vars['defaultThumb'] = $gallery->pictures[$gallery->vars['defaultPicture']]->vars['thumb']; - else { - foreach ($gallery->pictures as $p) { - $gallery->vars['defaultThumb'] = $p->vars['thumb']; - break; - } - } - } - - } else { - /* search thumbs in default value */ - $pictureIds = array(); - foreach ($list as $gallery) { - if ($gallery->vars['defaultPicture'] > 0) - $pictureIds[] = $gallery->vars['defaultPicture']; - } - $pictures = $this->get_pictures(array('ids'=>$pictureIds)); - foreach ($pictures as $picture) { - if (!isset($list[$picture->vars['gallery']])) - continue; - $list[$picture->vars['gallery']]->vars['defaultThumb'] = $picture->vars['thumb']; - } - - /* search thumb for "no default value" */ - $galleryIds = array(); - foreach ($list as $gallery) { - if ($gallery->vars['defaultThumb'] == '') - $galleryIds[] = $gallery->id; - } - $pictures = $this->get_galleriesFirstPictures(array('galleries'=>$galleryIds, 'status'=>$params['status']==-1?-1:1)); - foreach ($pictures as $picture) { - if (!isset($list[$picture->vars['gallery']])) - continue; - $list[$picture->vars['gallery']]->vars['defaultThumb'] = $picture->vars['thumb']; - } - } - } - - /* return list */ - return $list; - } - - /* - * return product count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('status'=>-1, 'ids'=>-1); - $params = array_merge($p, $params); - $where = $this->build_whereStatement($params); - - return $this->get_objectCount($where); - } - - /* - * return title list - * @param array $params - * @return array - * @access private - */ - function get_titleList($params=array()) { - global $camyks; - - /* default params list */ - $dParams = array('status'=>-1, 'addNone'=>0, 'addAll'=>0, 'language'=>$camyks->current_language); - - /* merge params */ - $params = array_merge($dParams, $params); - - /* build where statement */ - $w = $this->build_whereStatement($params); - - $l = array(); - if ($params['addNone'] == 1) - $l['-1'] = $this->get_translation('picturegallery_none'); - if ($params['addAll'] == 1) - $l['0'] = $this->get_translation('picturegalleries_all'); - - /* return title list */ - return $l + $this->get_nameList('title', $w, $params['language']); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - - /* check status */ - if ($params['status'] != -1) - $w[] = 'status = '.$params['status']; - - /* return result */ - return implode(' and ', $w); - } - - /* - * load pictures - * @param array $params - * @return boolean success - * @access public - */ - function load_pictures($params=array()) { - $dParams = array('gallery'=>$this->id); - $params = array_merge($dParams, $params); - $this->pictures = $this->_libParent->get_pictureList($params); - return true; - } - - /* - * return pictures - * @param array $params - * @return array - * @access public - */ - function get_pictures($params=array()) { - return $this->_libParent->get_pictureList($params); - } - - /* - * return first pictures for given galleries - * @param array $params - * @return arrray - * @access public - */ - function get_galleriesFirstPictures($params=array()) { - return $this->_libParent->get_firstPicturesList($params); - } - - /* - * check for default picture - * @param int $pictureId - * @return void - * @access public - */ - function check_forDefaultPicture($pictureId=0) { - if ($pictureId == 0) return; - if ($this->vars['defaultPicture'] > 0) - return; - $this->_libItems['defaultPicture']->value = $pictureId; - $this->update_databaseSpecificItems(array('defaultPicture')); - } -} -?> \ No newline at end of file + + * @version 1.0.1.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericMediaLibraryManagerPictureGallery class. + */ +final class Admin_GenericMediaLibraryManagerPictureGallery extends ModuleLibrary { + /** + * var array $pictures + * @brief Picture list. + */ + public $pictures = array(); + + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Define main attributes */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); + $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); + $this->add_newItem('summary', 'db', 'text', 'text', '', '', true); + $this->add_newItem('content', 'db', 'text', 'text', '', '', true); + $this->add_newItem('defaultPicture', 'db', 'int', 'bigint unsigned', '', 0); + + /* Temporary items */ + $this->add_newItem('pictures', 'temp', 'int', '', '', 0); + $this->add_newItem('defaultThumb', 'temp', 'text', '', '', ''); + + /* Generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary methods */ + + /** + * Build sql condition for lists. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + if (isset($params['status']) and $params['status'] > -1) + return 'status='.$params['status']; + return ''; + } + + /** + * Delete object. + * @return boolean success + */ + public function delete() { + /* delete objects */ + if (!parent::delete()) + return false; + + /* delete pictures files */ + + /* delete pictures db entries */ + + /* Return result */ + return true; + } + + /* Specific tool methods */ + + /** + * Return single object status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('picturegallerystatus_inactive'), + 1 => $this->get_translation('picturegallerystatus_public'), + 2 => $this->get_translation('picturegallerystatus_private'), + ); + } + + /** + * Return multi object status list. + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if ($full) + $list['-1'] = $this->get_translation('picturegalleries_all'); + $list['0'] = $this->get_translation('picturegalleriesstatus_inactive'); + $list['1'] = $this->get_translation('picturegalleriesstatus_public'); + $list['2'] = $this->get_translation('picturegalleriesstatus_private'); + return $list; + } + + /** + * Return single object status list. + * @return array + */ + public function get_statusIconList() { + return array( + 0 => ''.$this->get_translation('picturegallerystatus_inactive').'', + 1 => ''.$this->get_translation('picturegallerystatus_public').'', + 2 => ''.$this->get_translation('picturegallerystatus_private').'', + ); + } + + /** + * Return object list. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + + /* Build default params list */ + $dParams = array('status'=>-1, 'ids'=>-1, 'language'=>$camyks->current_language, 'load_pictures'=>0, 'load_defaultThumb'=>0, 'limit'=>-1, 'count'=>-1, 'order'=>'cdate', 'orderway'=>'desc'); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Build where statement */ + $where = $this->build_whereStatement($params); + + /* Load list */ + $list = $this->get_objectList($params['language'], $where, $params['limit'], $params['count'], $params['order'], $params['orderway']); + + /* Check for load pictures option */ + if ($params['load_pictures'] > 0) { + $galleryIds = array(); + foreach ($list as $gallery) + $galleryIds[] = $gallery->id; + $pictures = $this->get_pictures(array('galleries'=>$galleryIds, 'status'=>$params['status']==-1?-1:1)); + foreach ($pictures as $picture) { + if (!isset($list[$picture->vars['gallery']])) + continue; + $list[$picture->vars['gallery']]->pictures[$picture->id] = &$picture; + } + } + + /* Check for load default thumb option */ + if ($params['load_defaultThumb'] > 0) { + if ($params['load_pictures'] > 0) { + /* Search thumbs in loaded pictures */ + foreach ($list as &$gallery) { + if (isset($gallery->pictures[$gallery->vars['defaultPicture']])) + $gallery->vars['defaultThumb'] = $gallery->pictures[$gallery->vars['defaultPicture']]->vars['thumb']; + else { + foreach ($gallery->pictures as $p) { + $gallery->vars['defaultThumb'] = $p->vars['thumb']; + break; + } + } + } + + } else { + /* Search thumbs in default value */ + $pictureIds = array(); + foreach ($list as $gallery) { + if ($gallery->vars['defaultPicture'] > 0) + $pictureIds[] = $gallery->vars['defaultPicture']; + } + $pictures = $this->get_pictures(array('ids'=>$pictureIds)); + foreach ($pictures as $picture) { + if (!isset($list[$picture->vars['gallery']])) + continue; + $list[$picture->vars['gallery']]->vars['defaultThumb'] = $picture->vars['thumb']; + } + + /* Search thumb for "no default value" */ + $galleryIds = array(); + foreach ($list as $gallery) { + if ($gallery->vars['defaultThumb'] == '') + $galleryIds[] = $gallery->id; + } + $pictures = $this->get_galleriesFirstPictures(array('galleries'=>$galleryIds, 'status'=>$params['status']==-1?-1:1)); + foreach ($pictures as $picture) { + if (!isset($list[$picture->vars['gallery']])) + continue; + $list[$picture->vars['gallery']]->vars['defaultThumb'] = $picture->vars['thumb']; + } + } + } + + /* Return list */ + return $list; + } + + /** + * Return product count with given params. + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + $p = array('status'=>-1, 'ids'=>-1); + $params = array_merge($p, $params); + $where = $this->build_whereStatement($params); + + return $this->get_objectCount($where); + } + + /** + * Return title list. + * @param array $params + * @return array + */ + public function get_titleList($params=array()) { + global $camyks; + + /* Build default params list */ + $dParams = array('status'=>-1, 'addNone'=>0, 'addAll'=>0, 'language'=>$camyks->current_language); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Build where statement */ + $where = $this->build_whereStatement($params); + + $l = array(); + if ($params['addNone'] == 1) + $l['-1'] = $this->get_translation('picturegallery_none'); + if ($params['addAll'] == 1) + $l['0'] = $this->get_translation('picturegalleries_all'); + + /* Return title list */ + return $l + $this->get_nameList('title', $where, $params['language']); + } + + /** + * Build where statement from params. + * @param array $params + * @return string + */ + private function build_whereStatement($params=array()) { + $w = array(); + + /* Check status */ + if ($params['status'] != -1) + $w[] = 'status = '.$params['status']; + + /* Return result */ + return implode(' and ', $w); + } + + /** + * Load pictures. + * @param array $params + * @return boolean success + */ + private function load_pictures($params=array()) { + /* Build default params list */ + $dParams = array('gallery'=>$this->id); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Load pictures */ + $this->pictures = $this->_libParent->get_pictureList($params); + return true; + } + + /** + * Return pictures. + * @param array $params + * @return array + */ + public function get_pictures($params=array()) { + return $this->_libParent->get_pictureList($params); + } + + /** + * Return first pictures for given galleries. + * @param array $params + * @return arrray + */ + public function get_galleriesFirstPictures($params=array()) { + return $this->_libParent->get_firstPicturesList($params); + } + + /** + * Check for default picture. + * @param int $pictureId + * @return void + */ + public function check_forDefaultPicture($pictureId=0) { + if ($pictureId == 0) return; + if ($this->vars['defaultPicture'] > 0) + return; + $this->_libItems['defaultPicture']->value = $pictureId; + $this->update_databaseSpecificItems(array('defaultPicture')); + } +} +?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGalleryListParams.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGalleryListParams.php.inc index af81617a..978e59c0 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGalleryListParams.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGalleryListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Jun 2015 - * Last Modif Date : Jun 2015 - * - * Admin_GenericMediaLibraryManager PictureGallery list parameters +/** + * @brief Admin_GenericMediaLibraryManager Module picture gallery list parameters + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -29,8 +28,10 @@ $this->pictureGalleryListParams = array('name'=>'pictureGalleryList', 'useSessio $this->pictureGalleryListParams['headhiddens'] = array('openTab'=>'PictureGalleries'); /* build head parameters */ -$this->pictureGalleryListParams['headselectors'] = array('page'=> array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->pictureGalleriesStatusList, 'default'=>'-1')); +$this->pictureGalleryListParams['headselectors'] = array( + 'page' => array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->pictureGalleriesStatusList, 'default'=>'-1'), +); /* build sort parameters */ $this->pictureGalleryListParams['sort'] = array('allowed'=>false, 'default'=>'cdate', 'defaultway'=>'desc'); @@ -38,11 +39,13 @@ $this->pictureGalleryListParams['sort'] = array('allowed'=>false, 'default'=>'cd /* build column parameters */ $this->pictureGalleryListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewpicturegallery'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editPictureGalleryLink, 0), 'titlecolumn'=>'title', 'buttoncolumn'=>'view')); -$this->pictureGalleryListParams['listcolumns'] = array('status'=>array('title'=>' ', 'columntype'=>'list', 'values'=>$this->pictureGalleryStatusIconList, 'class'=>'eTableIconCell'), - 'title'=>array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), - 'pictures'=>array('title'=>$this->get_translation('pictures'), 'columntype'=>'text'), - 'summary'=>array('title'=>$this->get_translation('summary'), 'columntype'=>'text', 'maxlength'=>48), - 'cdate'=>array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numeric', 'style'=>'width:50px;'), - 'view'=>array('title'=>' ', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewPictureGalleryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('viewpicturegallery')), - 'delete'=>array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deletePictureGalleryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletepicturegallery'))); -?> \ No newline at end of file +$this->pictureGalleryListParams['listcolumns'] = array( + 'status' => array('title'=>' ', 'columntype'=>'list', 'values'=>$this->pictureGalleryStatusIconList, 'class'=>'eTableIconCell'), + 'title' => array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), + 'pictures' => array('title'=>$this->get_translation('pictures'), 'columntype'=>'text'), + 'summary' => array('title'=>$this->get_translation('summary'), 'columntype'=>'text', 'maxlength'=>48), + 'cdate' => array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numeric', 'style'=>'width:50px;'), + 'view' => array('title'=>' ', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewPictureGalleryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('viewpicturegallery')), + 'delete' => array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deletePictureGalleryLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletepicturegallery')), +); +?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureListParams.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureListParams.php.inc index 6f27c309..897b7db9 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureListParams.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0 - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Jun 2015 - * Last Modif Date : Nov 2017 - * - * Admin_GenericMediaLibraryManager picture list parameters +/** + * @brief Admin_GenericMediaLibraryManager Module picture list parameters + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -30,29 +29,29 @@ $this->pictureListParams = array('name'=>'pictureList', 'useSession'=>true, 'obj $this->pictureListParams['headhiddens'] = array('openTab'=>'Pictures', 'gallery'=>$this->pictureGalleryItem->id); /* build head parameters */ -$this->pictureListParams['headselectors'] = array('page'=> array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->picturesStatusList, 'default'=>'-1')); +$this->pictureListParams['headselectors'] = array( + 'page' => array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->picturesStatusList, 'default'=>'-1')); /* build sort parameters */ $this->pictureListParams['sort'] = array('allowed'=>false, 'default'=>'sortPosition', 'defaultway'=>'asc'); /* build column parameters */ -if ($this->check_right(2)==true) +if ($this->check_right(2)) $this->pictureListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewpicture'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editPictureLink, 0).'&gallery='.$this->pictureGalleryItem->id, 'titlecolumn'=>'title', 'buttoncolumn'=>'edit')); $this->pictureListParams['listcolumns'] = array( - 'status'=>array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), - 'default'=>array('title'=>' ', 'columntype'=>'method', 'method'=>'get_isDefaultPictureIcon', 'style'=>'width:12px;'), - 'title'=>array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), - 'cdate'=>array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numericwithhours', 'style'=>'width:100px;'), - /* 'infos'=>array('title'=>$this->get_translation('header_infos'), 'columntype'=>'method', 'method'=>'get_fileInfos'),*/ - 'view'=>array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewPictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('viewpicture')), + 'status' => array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), + 'default' => array('title'=>' ', 'columntype'=>'method', 'method'=>'get_isDefaultPictureIcon', 'style'=>'width:12px;'), + 'title' => array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), + 'cdate' => array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numericwithhours', 'style'=>'width:100px;'), + 'view' => array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewPictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('viewpicture')), ); -if ($this->check_right(2)==true ) { +if ($this->check_right(2)) { $this->pictureListParams['listcolumns']['movedown'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'down', 'url_value'=>$this->moveDownPictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('movedownpicture'), 'condition'=>'is_notLast'); $this->pictureListParams['listcolumns']['moveup'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'up', 'url_value'=>$this->moveUpPictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('moveuppicture'), 'condition'=>'is_notFirst'); $this->pictureListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editPictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editpicture')); $this->pictureListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deletePictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletepicture')); } -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureSelectionListParams.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureSelectionListParams.php.inc index 2252ae8c..7b4c2465 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureSelectionListParams.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureSelectionListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Jun 2015 - * Last Modif Date : Nov 2017 - * - * Admin_GenericMediaLibraryManager picture list parameters +/** + * @brief Admin_GenericMediaLibraryManager Module picture selection list parameters + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -32,10 +31,10 @@ $this->pictureListParams['headhiddens'] = array('openTab'=>'Pictures', 'gallery' $this->pictureListParams['sort'] = array('allowed'=>false, 'default'=>'sortPosition', 'defaultway'=>'asc'); /* build column parameters */ -$this->pictureListParams['listcolumns'] = array('thumbIcon'=>array('title'=>' ', 'columntype'=>'method', 'method'=>'get_isDefaultIconRadio', 'style'=>'width:20px;'), - 'title'=>array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), - 'cdate'=>array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numeric', 'style'=>'width:80px;'), - /* 'infos'=>array('title'=>$this->get_translation('header_infos'), 'columntype'=>'method', 'method'=>'get_fileInfos'),*/ - 'view'=>array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewPictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('viewpicture')), +$this->pictureListParams['listcolumns'] = array( + 'thumbIcon' => array('title'=>' ', 'columntype'=>'method', 'method'=>'get_isDefaultIconRadio', 'style'=>'width:20px;'), + 'title' => array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), + 'cdate' => array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numeric', 'style'=>'width:80px;'), + 'view' => array('title'=>'', 'columntype'=>'button', 'icon'=>'view', 'url_value'=>$this->viewPictureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('viewpicture')), ); ?> diff --git a/plugin/module/Admin_GenericMediaLibraryManager/locale/translation_fr.php.inc b/plugin/module/Admin_GenericMediaLibraryManager/locale/translation_fr.php.inc index a944ed0d..02bdf8a4 100755 --- a/plugin/module/Admin_GenericMediaLibraryManager/locale/translation_fr.php.inc +++ b/plugin/module/Admin_GenericMediaLibraryManager/locale/translation_fr.php.inc @@ -1,16 +1,15 @@ - * CaMykS Version : 1.0 - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Jun 2015 - * Last Modif Date : Nov 2017 - * - * Admin_GenericMediaLibraryManager french dictionnary -*/ +/** + * @brief Admin_GenericMediaLibraryManager Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_genericmedialibrarymanager_title'] = 'Médiathèque'; $this->trads['mod_admin_genericmedialibrarymanager_desc'] = 'Gestion de galeries d\'images'; @@ -128,5 +127,4 @@ $this->trads['mod_admin_genericmedialibrarymanager_picture_notdeleted'] = 'Une e $this->trads['mod_admin_genericmedialibrarymanager_MediaLibraryerrortitle'] = 'Le téléchargement du fichier a échoué.'; $this->trads['mod_admin_genericmedialibrarymanager_MediaLibraryerrordesc'] = 'Le fichier demandé n\'existe pas ou n\'est plus disponible au téléchargement.'; $this->trads['mod_admin_genericmedialibrarymanager_MediaLibraryerrorcnt1'] = 'Si le problème persiste, contactez l\'administrateur du site.'; - ?> diff --git a/plugin/module/Admin_GenericPetitionManager/Admin_GenericPetitionManager.php.inc b/plugin/module/Admin_GenericPetitionManager/Admin_GenericPetitionManager.php.inc index 2266f654..2f326453 100755 --- a/plugin/module/Admin_GenericPetitionManager/Admin_GenericPetitionManager.php.inc +++ b/plugin/module/Admin_GenericPetitionManager/Admin_GenericPetitionManager.php.inc @@ -1,804 +1,808 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * History : - * * 10-09-14 : Initial files - * - * Admin_GenericPetitionManager - */ - -class Admin_GenericPetitionManager extends Module { - /* variables */ - var $config; - var $petitionItem; - var $signatureItem; - var $petitionList; - var $signatureList; - - /* - * constructor - * @param string $path_type - */ - function Admin_GenericPetitionManager ( $path_type ) { - parent::Module('Admin_GenericPetitionManager', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'content'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Generic'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* load plugin libraries */ - $this->libs[] = 'Admin_GenericPetitionManagerPetition.php.inc'; - $this->libs[] = 'Admin_GenericPetitionManagerSignature.php.inc'; - $this->get_PHPLibs(); - - /* initialise plugin libraries */ - $this->petitionItem = new Admin_GenericPetitionManagerPetition(0, $this); - $this->signatureItem = new Admin_GenericPetitionManagerSignature(0, $this); - - /* initialise plugin variables */ - $this->petitionList = null; - $this->signatureList = null; - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - return ( $this->petitionItem->install() - and $this->signatureItem->install() and parent::install()); - } - - /* - * unintall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - return parent::uninstall(); - } - - /* - * check module installation - * @return boolean result - * @access private - */ - function is_installed () { - return $this->petitionItem->is_installed(); - } - - /* - * get module rights - * @return void - * @access private - */ - function get_rights() { - global $camyks; - $this->rights[0] = array('name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> true); - $this->rights[1] = array('name'=>'configuration', - 'title'=> $this->get_translation('rights_configuration'), - 'default'=> false); - $this->rights[2] = array('name'=>'petition', - 'title'=> $this->get_translation('rights_petition'), - 'default'=> false); - $this->rights[3] = array('name'=>'signature', - 'title'=> $this->get_translation('rights_signature'), - 'default'=> false); - } - - /* - * register a menu in admin interface - * @return array - * @access private - */ - function get_adminEngineSpecificMenus( ) { - if ( $this->check_right(1)===true and $this->mode == 'list_signature') { - return array(array('name'=>'petitionmanager', - 'title'=>$this->get_translation('menutitle'))); - } - return array(); - } - - /* - * register menu items in admin interface - * @return array - * @access private - */ - function get_adminEngineSpecificMenuItems( ) { - global $camyks; - /* set menus */ - if ( $this->check_right(1)===true and $this->mode == 'list_signature' ) { - return array(array('name'=>'exportXLS', - 'title'=>$this->get_translation('xlsexport'), - 'icon'=>$this->get_fileURL('img/xls.gif'), - 'menu'=>'petitionmanager', - 'url'=>'javascript:window.open(\'request.php?module='.$this->name.'&mode=exportxls&petition_id='.$this->petitionItem->id.'\');void(0);'), - ); - } - return array(); - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - - /* check user rights */ - if ( $this->check_right(0) === false ) - return $this->init_admin_accessDenied(); - - /* check dependencies */ - if(!isset($camyks->inputs['TabBuilder'])) - return $this->init_admin_missingPlugin('Input', 'TabBuilder'); - if (!isset($camyks->inputs['AdminItemListViewer'])) - return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); - if (!isset($camyks->inputs['TinyMCEv3'])) - return $this->init_admin_missingPlugin('Input', 'TinyMCEv3'); - - /* get informations */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'main' ); - - switch ( $this->mode ) { - case 'edit_petition': - /* mode == edit_petition */ - $this->init_admin_edit_petition(); - break; - case 'save_petition': - /* mode == save_petition */ - $this->init_admin_save_petition(); - break; - case 'delete_petition': - /* mode == delete_petition */ - $this->init_admin_delete_petition(); - break; - case 'list_signature': - /* mode == list_signature */ - $this->init_admin_list_signature(); - break; - case 'edit_signature': - /* mode == edit_signature */ - $this->init_admin_edit_signature(); - break; - case 'save_signature': - /* mode == save_signature */ - $this->init_admin_save_signature(); - break; - case 'delete_signature': - /* mode == delete_signature */ - $this->init_admin_delete_signature(); - break; - case 'main': - default: - /* mode == main */ - $this->init_admin_main(); - } - - parent::init_admin(); - } - - /* - * display module object in admin mode - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* - * execute module object in request mode - * @return void - * @access private - */ - function execute_request() { - global $camyks; - - /* load admin context */ - $camyks->get_adminInit(); - if ( !$camyks->check_adminUser() ) { - /* throw fatal error */ - $error = array('title'=>$this->get_translation('fatalerror_adminonly'), - 'description'=>$this->get_translation('fatalerror_youmustbelogged')); - $camyks->throwFatalError( $error ); - } - - $camyks->current_language = 'en'; - - /* check action value */ - if ( isset( $_REQUEST['mode'] ) ) { - $action = $_REQUEST['mode']; - } else { - /* throw fatal error */ - $error = array('title'=>$this->get_translation('fatalerror_actionundefined'), - 'description'=>$this->get_translation('fatalerror_actionmustbeset')); - $camyks->throwFatalError( $error ); - } - - /* execute action */ - switch ( $action ) { - case 'exportxls': - return $this->execute_request_exportXLS(); - default : - /* throw fatal error */ - $error = array('title'=>$this->get_translation('fatalerror_actionundefined'), - 'description'=>$this->get_translation('fatalerror_actionmustbeset')); - $camyks->throwFatalError( $error ); - } - } - - /* specific admin mode methods */ - - /* - * init module object in admin/main mode - * @return void - * @access private - */ - function init_admin_main() { - global $camyks; - - /* set main mode */ - $this->mode = 'main'; - - /* get help */ - $this->get_help(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - - /* build petition tab */ - $this->load_file('lib/Admin_GenericPetitionManagerPetitionListParams.php.inc'); - $this->petitionList = &$camyks->inputs['AdminItemListViewer']; - $this->petitionList->set_params($this->petitionListParams); - $this->petitionList->initialise(); - - /* get petition ids */ - $petitionIDs = array_keys($this->petitionList->objectList); - $cnts = $this->count_signsByPetitions($petitionIDs); - foreach( $this->petitionList->objectList as $id => &$petition) - $petition->vars['signs'] = isset($cnts[$id])?$cnts[$id]:0; - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - /* add petitions tab */ - $this->tabBuilder->add_tab(array('name'=>'petitions', - 'title'=>$this->get_translation('tabpetitions'))); - /* add help tab */ - if ( $this->help != null ) - $this->tabBuilder(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'petitions')); - - /* get buttons */ - $this->buttons = array(array('link'=>$camyks->get_adminLink(), - 'title'=>$camyks->get_translation('back'))); - } - - /* - * init module object in admin/edit_petition mode - * @return void - * @access private - */ - function init_admin_edit_petition() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - $this->lgs = $camyks->get_confValue('editing_languages'); - - /* get petition item */ - $petition_id = isset($_REQUEST['petition_id'])?$_REQUEST['petition_id']:0; - $this->petitionItem->id = $petition_id; - $this->petitionItem->get(); - $this->petitionItem->get_fromItems(); - - /* get form */ - $this->editform = new HTMLForm('edit_petition', - $camyks->get_adminlink( $this->name, array('mode'=>'save_petition')), - 'POST'); - $this->editform->add_hidden('petition_id', $this->petitionItem->id ); - $this->editform->set_object($this->petitionItem); - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - /* add petitions tab */ - $this->tabBuilder->add_tab(array('name'=>'properties', - 'title'=>$this->get_translation('tabproperties'))); - if ( count( $this->lgs ) == 1) - $this->tabBuilder->add_tab(array('name'=>$this->lgs[0], - 'title'=>$this->get_translation('tabcontent'))); - else - foreach ( $this->lgs as $l ) - $this->tabBuilder->add_tab(array('name'=>$l, - 'title'=>language_getIcon($l))); - /* add help tab */ - if ( $this->help != null ) - $this->tabBuilder->add_tab(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'properties')); - - /* load editor */ - $this->editor = &$camyks->inputs['TinyMCEv3']; - $this->editor->initialise(); - - /* build title */ - $this->adminTitle = $this->title; - $this->adminTitle .= $camyks->get_translation('formitem_separator'); - if ($this->petitionItem->id == 0 ) - $this->adminTitle .= $this->get_translation('petitionnew'); - else - $this->adminTitle .= $this->get_translation('petitionid', $this->petitionItem->id); - - /* build button list */ - $this->buttons = array(array('link'=>$this->get_adminLink(), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->editform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - - /* update layout */ - $this->selected_layout = 'admin_edit_petition.html.inc'; - } - - /* - * init module object in admin/save_petition mode - * @return void - * @access private - */ - function init_admin_save_petition() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check petition id */ - if ( !isset($_REQUEST['petition_id'])) - return $this->init_admin_main(); - $petition_id = $_REQUEST['petition_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save petition */ - $this->petitionItem->id = $petition_id; - $this->petitionItem->get_fromHeader(); - if ( $this->petitionItem->save() ) - $this->text = $this->get_translation('petition_saved'); - else - $this->text = $this->get_translation('petition_notsaved'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink()); - } - - /* - * init module object in admin/delete_petition mode - * @return void - * @access private - */ - function init_admin_delete_petition() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(2) === false ) - return $this->init_admin_actionNotAllowed () ; - - /* check petition id */ - if ( !isset($_REQUEST['petition_id'])) - return $this->init_admin_main(); - $petition_id = $_REQUEST['petition_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* delete petition */ - $this->petitionItem->id = $petition_id; - if ( $this->petitionItem->delete()) - $this->text = $this->get_translation('petition_deleted'); - else - $this->text = $this->get_translation('petition_notdeleted'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink()); - } - - /* - * init module object in admin/list_signature mode - * @return void - * @access private - */ - function init_admin_list_signature() { - global $camyks; - - /* check petition */ - if (!isset($_REQUEST['petition_id'])) - return $this->init_admin_main(); - - /* get petition id */ - $this->petitionItem->id = $_REQUEST['petition_id']; - - /* build petition tab */ - $this->load_file('lib/Admin_GenericPetitionManagerSignatureListParams.php.inc'); - $this->signList = &$camyks->inputs['AdminItemListViewer']; - $this->signList->set_params($this->signatureListParams); - $this->signList->initialise(); - - /* */ - $this->adminTitle = $this->title - .$camyks->get_translation('formitem_separator') - .$this->get_translation('title_listsignature'); - - /* get buttons */ - $this->buttons = array(array('link'=>$this->get_adminLink(), - 'title'=>$camyks->get_translation('back'))); - - /* update layout */ - $this->selected_layout = 'admin_list_sign.html.inc'; - } - - /* - * init module object in admin/edit_signature mode - * @return void - * @access private - */ - function init_admin_edit_signature() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed () ; - - /* get signature item */ - $signature_id = isset($_REQUEST['signature_id'])?$_REQUEST['signature_id']:0; - $this->signatureItem->id = $signature_id; - $this->signatureItem->get(); - $this->signatureItem->get_fromItems(); - - /* get form */ - $this->editform = new HTMLForm('edit_signature', - $this->get_adminlink(array('mode'=>'save_signature')), - 'POST'); - $this->editform->set_object($this->signatureItem); - $this->editform->add_hidden('signature_id', $this->signatureItem->id ); - $this->editform->add_hidden('petition', $this->signatureItem->vars['petition']); - - /* build button list */ - $this->buttons = array(array('link'=>$this->get_adminLink(array('openTab'=>'categories')), - 'title'=>$camyks->get_translation('back')), - array('link'=>$this->editform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'))); - - /* set interface title */ - $this->adminTitle = $this->title - .$camyks->get_translation('formitem_separator') - .$this->get_translation('signatureid', $this->signatureItem->id); - - /* update layout */ - $this->selected_layout = 'admin_edit_signature.html.inc'; - } - - /* - * init module object in admin/save_signature mode - * @return void - * @access private - */ - function init_admin_save_signature() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check signature id */ - if(!isset($_REQUEST['signature_id'])) - return $this->init_admin_main(); - $signature_id = $_REQUEST['signature_id']; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save signature */ - $this->signatureItem->id = $signature_id; - $this->signatureItem->get_fromHeader(); - if ( $this->signatureItem->save() ) - $this->text = $this->get_translation('signature_saved'); - else - $this->text = $this->get_translation('signature_notsaved'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink(array('openTab'=>'categories'))); - } - - /* - * init module object in admin/delete_signature mode - * @return void - * @access private - */ - function init_admin_delete_signature() { - global $camyks; - - /* check user rights */ - if ( $this->check_right(1) === false ) - return $this->init_admin_actionNotAllowed(); - - /* check signature id */ - if(!isset($_REQUEST['signature_id'])) - return $this->init_admin_main(); - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* delete signature */ - $this->signatureItem->id = $_REQUEST['signature_id']; - $this->signatureItem->get(); - $this->signatureItem->get_fromItems(); - - $p_id = $this->signatureItem->vars['petition_id']; - - if ( $this->signatureItem->delete()) - $this->text = $this->get_translation('signature_deleted'); - else - $this->text = $this->get_translation('signature_notdeleted'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect(4, $this->get_adminLink(array('mode'=>'list_signature', 'petition_id'=>$p_id))); - } - - /* specific request mode methods */ - - /* - * export results - * @param string $where - * @return void - * @access private - */ - function execute_request_exportXLS() { - global $camyks; - - /* load petition item */ - if( !isset($_REQUEST['petition_id'])) { - /* throw fatal error */ - $error = array('title'=>$this->get_translation('fatalerror_undefinedpetition'), - 'description'=>$this->get_translation('fatalerror_')); - $camyks->throwFatalError( $error ); - } - $this->petitionItem->id = $_REQUEST['petition_id']; - $this->petitionItem->get(); - $this->petitionItem->get_fromItems($camyks->current_language); - - /* load external data */ - countries_loadLocales(); - - /* load excel writer library */ - require_once('Spreadsheet/Excel/Writer.php'); - - /* prepare sql query */ - $params = array('status'=>1, 'petition'=>$this->petitionItem->id, 'order'=>'signdate', 'orderway'=>'asc'); - $where = $this->signatureItem->build_whereStatement($params); - $sql = $this->signatureItem->get_objectList_databaseItemsSQLQuery($where, -1, -1, $params['order'], $params['orderway']); - - /* Creating a workbook */ - $workbook = new Spreadsheet_Excel_Writer(); - - /* sending HTTP headers */ - $workbook->send($this->petitionItem->vars['title'].'-'.strftime('%Y-%m-%d').'.xls'); - - /* Creating a worksheet */ - $worksheet =& $workbook->addWorksheet($this->get_translation('export_signatures')); - - /* creates formats */ - $header = &$workbook->addFormat(); - $header->setBold(700); - - $sday = 86400; - $tdiff = $sday * 25569; - - $sdate = &$workbook->addFormat(); - $sdate->setNumFormat('D/M/YY'); - - $ldate = &$workbook->addFormat(); - $ldate->setNumFormat('D/M/YY h:mm'); - - /* add header line */ - $c = 0; - $worksheet->write(0, $c++, '#', $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($this->get_translation('export_signdate'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('civility'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('firstname'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('lastname'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('email'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('address'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('zipcode'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('city'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('country'))), $header); - $worksheet->write(0, $c++, utf8_decode(string_html2text($this->get_translation('export_birthdate'))), $header); - - /* add sign data */ - $cnt = 0; - $l = 1; - /* execute sql query */ - if ( $req = mysql_query($sql) or $camyks->log_sqlerror( $this, $sql, __FILE__, __LINE__ ) ) { - /* get data from database */ - while ( $data = mysql_fetch_assoc( $req )) { - $c = 0; - $worksheet->write($l, $c++, ++$cnt); - $worksheet->write($l, $c++, number_format(($data['signdate'] + $tdiff) / $sday, 6,'.', ''), $ldate); - $worksheet->write($l, $c++, $data['title']); - $worksheet->write($l, $c++, utf8_decode($data['firstname'])); - $worksheet->write($l, $c++, utf8_decode($data['lastname'])); - $worksheet->write($l, $c++, $data['email']); - $worksheet->write($l, $c++, utf8_decode($data['address'])); - $worksheet->write($l, $c++, ' '.$data['zipcode']); - $worksheet->write($l, $c++, utf8_decode($data['city'])); - $worksheet->write($l, $c++, ($data['country']!=''?countries_getTranslation($data['country']):'')); - $worksheet->write($l, $c++, number_format(($data['birthdate'] + $tdiff) / $sday, 6,'.', ''), $sdate); - $l++; - } - } - - /* send the file */ - $workbook->close(); - } - - /* specific admin tool methods */ - - /* - * return signature status list - * @return array - * @access public - */ - function get_signatureStatusList() { - return $this->signatureItem->get_statusList(); - } - - /* - * return signatures status list - * @param boolean $full - * @return array - * @access public - */ - function get_signaturesStatusList($full=false) { - return $this->signatureItem->get_multiStatusList($full); - } - - /* - * return signature list - * @param array $params - * @return array - * @access public - */ - function get_signatureList($params=array()) { - return $this->signatureItem->get_list($params); - } - - /* - * return signature title list - * @param boolean $full - * @param array $params - * @return array - * @access public - */ - function get_signatureTitleList($full=false, $params=array()) { - if (!isset($params['language'])) - $params['language'] = $this->get_adminEditionLanguage(); - - $list = $this->signatureItem->get_titleList($params); - if ($full) - $list = array(0=>$this->get_translation('signaturetitle_all'))+ $list; - return $list; - } - - /* - * return petition status list - * @return array - * @access public - */ - function get_petitionStatusList() { - return $this->petitionItem->get_statusList(); - } - - /* - * return petitions status list - * @param boolean $full - * @return array - * @access public - */ - function get_petitionsStatusList($full=false) { - return $this->petitionItem->get_multiStatusList($full); - } - - /* - * return petition type list - * @return array - * @access public - */ - function get_petitionTypeList() { - return $this->petitionItem->get_typeList(); - } - - /* - * return petitions type list - * @param boolean $full - * @return array - * @access public - */ - function get_petitionsTypeList($full=false) { - return $this->petitionItem->get_multiTypeList($full); - } - - /* - * return petition title list - * @param array $params - * @return array - * @access public - */ - function get_petitionTitleList($params=array()) { - return $this->petitionItem->get_titleList($params); - } - - /* - * return petition list - * @param array $params - * @return array - * @access public - */ - function get_petitionList($params=array()) { - return $this->petitionItem->get_list($params); - } - - /* - * return petition count - * @param array $params - * @return array - * @access public - */ - function count_petitions($params=array()) { - return $this->petitionItem->count($params); - } - - /* - * return signs count by given petition - * @param array $petitions - * @return array - * @access public - */ - function count_signsByPetitions($petitions) { - return $this->signatureItem->count_byPetitions($petitions); - } -} -?> \ No newline at end of file + Manages petitions. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Sep 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericPetitionManager class. + */ +final class Admin_GenericPetitionManager extends Module { + /** + * var Object $petitionItem + * @brief Petition object. + */ + public $petitionItem; + + /** + * var array $petitionList + * @brief Petition list. + */ + public $petitionList = null; + + /** + * var Object $signatureItem + * @brief Signature object. + */ + public $signatureItem; + + /** + * var array $signatureList + * @brief Signature list. + */ + public $signatureList = null; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_GenericPetitionManager', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'Generic'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'content'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load plugin libraries */ + $this->load_library('Admin_GenericPetitionManagerPetition'); + $this->load_library('Admin_GenericPetitionManagerSignature'); + + /* Initialise plugin libraries */ + $this->petitionItem = new Admin_GenericPetitionManagerPetition(0, $this); + $this->signatureItem = new Admin_GenericPetitionManagerSignature(0, $this); + } + + /* Override Module methods */ + + /** + * Install module. + * @return boolean success + */ + public function install() { + return ($this->petitionItem->install() and $this->signatureItem->install() and parent::install()); + } + + /** + * Check module installation. + * @return boolean result + */ + public function is_installed() { + return $this->petitionItem->is_installed(); + } + + /** + * Define module permission. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => true, + ); + $this->rights[1] = array( + 'name' => 'configuration', + 'title' => $this->get_translation('rights_configuration'), + 'default' => false, + ); + $this->rights[2] = array( + 'name' => 'petition', + 'title' => $this->get_translation('rights_petition'), + 'default' => false, + ); + $this->rights[3] = array( + 'name' => 'signature', + 'title' => $this->get_translation('rights_signature'), + 'default' => false, + ); + } + + /** + * Register a menu in admin interface. + * @return array + */ + public function get_adminEngineSpecificMenus() { + if ($this->check_right(1) and $this->mode == 'list_signature') { + return array( + array( + 'name' => 'petitionmanager', + 'title' => $this->get_translation('menutitle'), + ), + ); + } + return array(); + } + + /** + * Register menu items in admin interface. + * @return array + */ + public function get_adminEngineSpecificMenuItems() { + if ($this->check_right(1) and $this->mode == 'list_signature') { + return array( + array( + 'name' => 'exportXLS', + 'title' => $this->get_translation('xlsexport'), + 'icon' => $this->get_fileURL('img/xls.gif'), + 'menu' => 'petitionmanager', + 'url' => 'javascript:window.open(\'request.php?module='.$this->name.'&mode=exportxls&petition_id='.$this->petitionItem->id.'\');void(0);' + ), + ); + } + return array(); + } + + /** + * Initialise module object in admin mode + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Check dependencies */ + if (!isset($camyks->inputs['TabBuilder'])) + return $this->init_admin_missingPlugin('Input', 'TabBuilder'); + if (!isset($camyks->inputs['AdminItemListViewer'])) + return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); + if (!isset($camyks->inputs['TinyMCEv3'])) + return $this->init_admin_missingPlugin('Input', 'TinyMCEv3'); + + /* Load action to execute */ + $this->mode = isset ($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'; + + switch ($this->mode) { + case 'edit_petition': + /* mode == edit_petition */ + $this->init_admin_edit_petition(); + break; + case 'save_petition': + /* mode == save_petition */ + $this->init_admin_save_petition(); + break; + case 'delete_petition': + /* mode == delete_petition */ + $this->init_admin_delete_petition(); + break; + case 'list_signature': + /* mode == list_signature */ + $this->init_admin_list_signature(); + break; + case 'edit_signature': + /* mode == edit_signature */ + $this->init_admin_edit_signature(); + break; + case 'save_signature': + /* mode == save_signature */ + $this->init_admin_save_signature(); + break; + case 'delete_signature': + /* mode == delete_signature */ + $this->init_admin_delete_signature(); + break; + case 'main': + default: + /* mode == main */ + $this->init_admin_main(); + } + + /* Perform generic initialisation */ + parent::init_admin(); + } + + /** + * Execute module object in request mode. + * @return void + */ + public function execute_request() { + global $camyks; + + /* Load admin context */ + $camyks->get_adminInit(); + if (!$camyks->check_adminUser()) { + /* Throw fatal error */ + $camyks->throwFatalError(array( + 'title' => $this->get_translation('fatalerror_adminonly'), + 'description' => $this->get_translation('fatalerror_youmustbelogged'), + )); + } + + $camyks->current_language = 'en'; + + /* Check action value */ + if (isset($_REQUEST['mode'])) { + $action = $_REQUEST['mode']; + } else { + /* Throw fatal error */ + $camyks->throwFatalError(array( + 'title' => $this->get_translation('fatalerror_actionundefined'), + 'description' => $this->get_translation('fatalerror_actionmustbeset'), + )); + } + + /* Execute action */ + switch ($action) { + case 'exportxls': + return $this->execute_request_exportXLS(); + default : + /* Throw fatal error */ + $camyks->throwFatalError(array( + 'title' => $this->get_translation('fatalerror_actionundefined'), + 'description' => $this->get_translation('fatalerror_actionmustbeset') + )); + } + } + + /* Specific admin mode methods */ + + /** + * Initialise module object in admin/main mode. + * @return void + */ + private function init_admin_main() { + global $camyks; + + /* Define main mode */ + $this->mode = 'main'; + + /* Load help */ + $this->get_help(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + + /* Build petition tab */ + $this->load_library('Admin_GenericPetitionManagerPetitionListParams'); + $this->petitionList = $camyks->get_input('AdminItemListViewer'); + $this->petitionList->set_params($this->petitionListParams); + $this->petitionList->initialise(); + + /* Load petition ids */ + $petitionIDs = array_keys($this->petitionList->objectList); + $cnts = $this->count_signsByPetitions($petitionIDs); + foreach ($this->petitionList->objectList as $id => &$petition) + $petition->vars['signs'] = isset($cnts[$id]) ? $cnts[$id] : 0; + + /* Load tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + + /* Add petitions tab */ + $this->tabBuilder->add_tab(array( + 'name' => 'petitions', + 'title' => $this->get_translation('tabpetitions'), + )); + + /* Add help tab */ + if ($this->help != null) + $this->tabBuilder(array( + 'name'=>'help', + 'title'=>$camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'petitions')); + + /* Build interface buttons */ + $this->buttons = array( + array( + 'link' => $camyks->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + ); + } + + /** + * Initialise module object in admin/edit_petition mode. + * @return void + */ + private function init_admin_edit_petition() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + $this->lgs = $camyks->get_confValue('editing_languages'); + + /* Load petition item */ + $this->petitionItem->id = isset($_REQUEST['petition_id']) ? $_REQUEST['petition_id'] : 0; + $this->petitionItem->get(); + $this->petitionItem->get_fromItems(); + + /* Build form */ + $this->editform = new HTMLForm('edit_petition', $this->get_adminlink(array('mode'=>'save_petition')), 'POST'); + $this->editform->add_hidden('petition_id', $this->petitionItem->id); + $this->editform->set_object($this->petitionItem); + + /* Build tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + + /* Add petitions tab */ + $this->tabBuilder->add_tab(array( + 'name' => 'properties', + 'title' => $this->get_translation('tabproperties'), + )); + if (count($this->lgs)== 1) + $this->tabBuilder->add_tab(array( + 'name' => $this->lgs[0], + 'title' => $this->get_translation('tabcontent'), + )); + else + foreach ($this->lgs as $l) + $this->tabBuilder->add_tab(array( + 'name' => $l, + 'title' => language_getIcon($l), + )); + + /* Add help tab */ + if ($this->help != null) + $this->tabBuilder->add_tab(array( + 'name'=>'help', + 'title'=>$camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'properties')); + + /* Load editor */ + $this->editor = $camyks->get_input('TinyMCEv3'); + $this->editor->initialise(); + + /* Build interface title */ + $this->adminTitle = $this->title; + $this->adminTitle .= $camyks->get_translation('formitem_separator'); + if ($this->petitionItem->id == 0) + $this->adminTitle .= $this->get_translation('petitionnew'); + else + $this->adminTitle .= $this->get_translation('petitionid', $this->petitionItem->id); + + /* Build button list */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ) + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_petition.html.inc'); + } + + /** + * Initialise module object in admin/save_petition mode + * @return void + */ + private function init_admin_save_petition() { + global $camyks; + + /* Check user permissions */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check petition id */ + if (!isset($_REQUEST['petition_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save petition */ + $this->petitionItem->id = (int)$_REQUEST['petition_id']; + $this->petitionItem->get_fromHeader(); + if ($this->petitionItem->save()) + $this->text = $this->get_translation('petition_saved'); + else + $this->text = $this->get_translation('petition_notsaved'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/delete_petition mode. + * @return void + */ + private function init_admin_delete_petition() { + global $camyks; + + /* Check user permissions */ + if ($this->check_right(2) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check petition id */ + if (!isset($_REQUEST['petition_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Delete petition */ + $this->petitionItem->id = (int)$_REQUEST['petition_id']; + if ($this->petitionItem->delete()) + $this->text = $this->get_translation('petition_deleted'); + else + $this->text = $this->get_translation('petition_notdeleted'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/list_signature mode. + * @return void + */ + private function init_admin_list_signature() { + global $camyks; + + /* Check petition */ + if (!isset($_REQUEST['petition_id'])) + return $this->init_admin_main(); + + /* Load petition id */ + $this->petitionItem->id = (int)$_REQUEST['petition_id']; + + /* Build petition tab */ + $this->load_library('Admin_GenericPetitionManagerSignatureListParams'); + $this->signList = $camyks->get_input('AdminItemListViewer'); + $this->signList->set_params($this->signatureListParams); + $this->signList->initialise(); + + /* Build interface title */ + $this->adminTitle = $this->title.$camyks->get_translation('formitem_separator').$this->get_translation('title_listsignature'); + + /* Build interface buttons */ + $this->buttons = array( + array( + 'link'=>$this->get_adminLink(), + 'title'=>$camyks->get_translation('back'), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_list_sign.html.inc'); + } + + /** + * Initialise module object in admin/edit_signature mode. + * @return void + */ + private function init_admin_edit_signature() { + global $camyks; + + /* Check user permissions */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* get signature item */ + $this->signatureItem->id = isset($_REQUEST['signature_id']) ? (int)$_REQUEST['signature_id'] : 0; + $this->signatureItem->get(); + $this->signatureItem->get_fromItems(); + + /* get form */ + $this->editform = new HTMLForm('edit_signature', $this->get_adminlink(array('mode'=>'save_signature')), 'POST'); + $this->editform->set_object($this->signatureItem); + $this->editform->add_hidden('signature_id', $this->signatureItem->id); + $this->editform->add_hidden('petition', $this->signatureItem->vars['petition']); + + /* Build interface title */ + $this->adminTitle = $this->title.$camyks->get_translation('formitem_separator').$this->get_translation('signatureid', $this->signatureItem->id); + + /* Build buttons list */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(array('openTab'=>'categories')), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_signature.html.inc'); + } + + /** + * Initialise module object in admin/save_signature mode. + * @return void + */ + private function init_admin_save_signature() { + global $camyks; + + /* Check user permissions */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check signature id */ + if (!isset($_REQUEST['signature_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save signature */ + $this->signatureItem->id = (int)$_REQUEST['signature_id']; + $this->signatureItem->get_fromHeader(); + if ($this->signatureItem->save()) + $this->text = $this->get_translation('signature_saved'); + else + $this->text = $this->get_translation('signature_notsaved'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('mode'=>'list_signature', 'petition_id'=>$this->signatureItem->vars['petition_id']))); + } + + /** + * Initialise module object in admin/delete_signature mode. + * @return void + */ + private function init_admin_delete_signature() { + global $camyks; + + /* Check user permissions */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Check signature id */ + if (!isset($_REQUEST['signature_id'])) + return $this->init_admin_main(); + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Delete signature */ + $this->signatureItem->id = (int)$_REQUEST['signature_id']; + $this->signatureItem->get(); + $this->signatureItem->get_fromItems(); + if ($this->signatureItem->delete()) + $this->text = $this->get_translation('signature_deleted'); + else + $this->text = $this->get_translation('signature_notdeleted'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('mode'=>'list_signature', 'petition_id'=>$this->signatureItem->vars['petition_id']))); + } + + /* Specific request mode methods */ + + /** + * Execute module in execute/export results as XLS mode. + * @param string $where + * @return void + */ + private function execute_request_exportXLS() { + global $camyks; + + /* Load petition item */ + if (!isset($_REQUEST['petition_id'])) { + /* Throw fatal error */ + $camyks->throwFatalError(array( + 'title' => $this->get_translation('fatalerror_undefinedpetition'), + 'description' => $this->get_translation('fatalerror_'), + )); + } + $this->petitionItem->id = (int)$_REQUEST['petition_id']; + $this->petitionItem->get(); + $this->petitionItem->get_fromItems($camyks->current_language); + + /* Load external data */ + countries_loadLocales(); + + /* Load excel writer library */ + require_once('Spreadsheet/Excel/Writer.php'); + + /* prepare sql query */ + $params = array('status'=>1, 'petition'=>$this->petitionItem->id, 'order'=>'signdate', 'orderway'=>'asc'); + $where = $this->signatureItem->build_whereStatement($params); + $sql = $this->signatureItem->get_objectList_databaseItemsSQLQuery($where, -1, -1, $params['order'], $params['orderway']); + + /* Creating a workbook */ + $workbook = new Spreadsheet_Excel_Writer(); + + /* Sending HTTP headers */ + $workbook->send($this->petitionItem->vars['title'].'-'.strftime('%Y-%m-%d').'.xls'); + + /* Creating a worksheet */ + $worksheet =& $workbook->addWorksheet($this->get_translation('export_signatures')); + + /* Creates formats */ + $header = &$workbook->addFormat(); + $header->setBold(700); + + $sday = 86400; + $tdiff = $sday * 25569; + + $sdate = &$workbook->addFormat(); + $sdate->setNumFormat('D/M/YY'); + + $ldate = &$workbook->addFormat(); + $ldate->setNumFormat('D/M/YY h:mm'); + + /* Add header line */ + $c = 0; + $worksheet->write(0, $c++, '#', $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($this->get_translation('export_signdate'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('civility'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('firstname'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('lastname'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('email'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('address'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('zipcode'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('city'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($camyks->get_translation('country'))), $header); + $worksheet->write(0, $c++, utf8_decode(string_html2text($this->get_translation('export_birthdate'))), $header); + + /* Add sign data */ + $cnt = 0; + $l = 1; + + if ($this->signatureItem->execute_DBQuery($sql, __LINE__)) { + while ($data = $this->signatureItem->get_DBQueryDataLine()) { + $c = 0; + $worksheet->write($l, $c++, ++$cnt); + $worksheet->write($l, $c++, number_format(($data['signdate'] + $tdiff) / $sday, 6,'.', ''), $ldate); + $worksheet->write($l, $c++, $data['title']); + $worksheet->write($l, $c++, utf8_decode($data['firstname'])); + $worksheet->write($l, $c++, utf8_decode($data['lastname'])); + $worksheet->write($l, $c++, $data['email']); + $worksheet->write($l, $c++, utf8_decode($data['address'])); + $worksheet->write($l, $c++, ' '.$data['zipcode']); + $worksheet->write($l, $c++, utf8_decode($data['city'])); + $worksheet->write($l, $c++, ($data['country']!=''?countries_getTranslation($data['country']):'')); + $worksheet->write($l, $c++, number_format(($data['birthdate'] + $tdiff) / $sday, 6,'.', ''), $sdate); + $l++; + } + } + + /* Send the file */ + $workbook->close(); + } + + /* Specific admin tool methods */ + + /** + * Return signature status list. + * @return array + */ + public function get_signatureStatusList() { + return $this->signatureItem->get_statusList(); + } + + /** + * Return signatures status list. + * @param boolean $full + * @return array + */ + public function get_signaturesStatusList($full=false) { + return $this->signatureItem->get_multiStatusList($full); + } + + /** + * Return signature list. + * @param array $params + * @return array + */ + public function get_signatureList($params=array()) { + return $this->signatureItem->get_list($params); + } + + /** + * Return signature title list. + * @param boolean $full + * @param array $params + * @return array + */ + public function get_signatureTitleList($full=false, $params=array()) { + if (!isset($params['language'])) + $params['language'] = $this->get_adminEditionLanguage(); + + $list = $this->signatureItem->get_titleList($params); + if ($full) + $list = array(0=>$this->get_translation('signaturetitle_all'))+ $list; + return $list; + } + + /** + * Return petition status list. + * @return array + */ + public function get_petitionStatusList() { + return $this->petitionItem->get_statusList(); + } + + /** + * Return petitions status list. + * @param boolean $full + * @return array + */ + public function get_petitionsStatusList($full=false) { + return $this->petitionItem->get_multiStatusList($full); + } + + /** + * Return petition type list. + * @return array + */ + public function get_petitionTypeList() { + return $this->petitionItem->get_typeList(); + } + + /** + * Return petitions type list. + * @param boolean $full + * @return array + */ + public function get_petitionsTypeList($full=false) { + return $this->petitionItem->get_multiTypeList($full); + } + + /** + * Return petition title list. + * @param array $params + * @return array + */ + public function get_petitionTitleList($params=array()) { + return $this->petitionItem->get_titleList($params); + } + + /** + * Return petition list. + * @param array $params + * @return array + */ + public function get_petitionList($params=array()) { + return $this->petitionItem->get_list($params); + } + + /** + * Return petition count. + * @param array $params + * @return array + */ + public function count_petitions($params=array()) { + return $this->petitionItem->count($params); + } + + /** + * Return signs count by given petition. + * @param array $petitions + * @return array + */ + public function count_signsByPetitions($petitions) { + return $this->signatureItem->count_byPetitions($petitions); + } +} +?> diff --git a/plugin/module/Admin_GenericPetitionManager/html/admin.html.inc b/plugin/module/Admin_GenericPetitionManager/html/admin.html.inc index bf845c8b..bab5ecfc 100755 --- a/plugin/module/Admin_GenericPetitionManager/html/admin.html.inc +++ b/plugin/module/Admin_GenericPetitionManager/html/admin.html.inc @@ -1,30 +1,25 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : May 2010 - * Last Modif Date : May 2010 - * - * Admin_GenericPetitionManager Module Admin Layout : main -*/ -global $camyks; -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->title) ?> -theme->get_boxTabsBar($this->tabBuilder->tabs, - $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header( )?> -
- -petitionList->display('head');?> -petitionList->display('list');?> - -
- -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1 + * @date Creation: May 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header(); ?> +
+ petitionList->display('head');?> + petitionList->display('list');?> +
+theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericPetitionManager/html/admin_edit_petition.html.inc b/plugin/module/Admin_GenericPetitionManager/html/admin_edit_petition.html.inc index 4dc63ad4..f489d7fa 100755 --- a/plugin/module/Admin_GenericPetitionManager/html/admin_edit_petition.html.inc +++ b/plugin/module/Admin_GenericPetitionManager/html/admin_edit_petition.html.inc @@ -1,86 +1 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericPetitionManager Module Admin Layout : edit_petition - */ -global $camyks; - -$flags = array(); -$lgs = $camyks->get_confValue('editing_languages'); -if ( count($lgs) == 1) { - $flags[$lgs[0]] = ''; -} else { - foreach ($lgs as $l) - $flags[$l] = ''; -} -?> -theme->get_boxHeader('width:610px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxTabsBar($this->tabBuilder->tabs, - $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header( )?> -editform->display_header(); ?> -editform->display_hiddens(); ?> -
- - - - - - - - - - - - - - - - - - - - - -
-get_translation('formitem_status')?> - -editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_petitionStatusList()));?> -
- -get_translation('formitem_title')?> - -editform->display_textInput(array('name'=>'title', 'language'=>$l));?> -
-get_translation('formitem_cdate')?> - -editform->display_dateInput(array('name'=>'cdate'));?> -
-
- - - - -
- -editor->set_contentInfos('text', $this->petitionItem->vars['description_'.$l] ); ?> -editor->set_textareaInfos('description_'.$l, '100%', '400px'); ?> -editor->display();?> -
- - - -editform->display_footer(); ?> - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + * @version 1.0.1 * @date Creation: Sep 2010 * @date Modification: Jan 2021 * @copyright 2010 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; $flags = array(); $lgs = $camyks->get_confValue('editing_languages'); if (count($lgs) == 1) { $flags[$lgs[0]] = ''; } else { foreach ($lgs as $l) $flags[$l] = ''; } ?> theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> theme->get_boxHeader('width:610px;margin:0 auto;'); ?> theme->get_boxTitleBar($this->adminTitle); ?> theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> theme->get_boxContent2Header(); ?> editform->display_header(); ?> editform->display_hiddens(); ?>
get_translation('formitem_status'); ?> editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_petitionStatusList())); ?>
get_translation('formitem_title'); ?> editform->display_textInput(array('name'=>'title', 'language'=>$l)); ?>
get_translation('formitem_cdate'); ?> editform->display_dateInput(array('name'=>'cdate')); ?>
editor->set_contentInfos('text', $this->petitionItem->vars['description_'.$l]); ?> editor->set_textareaInfos('description_'.$l, '100%', '400px'); ?> editor->display(); ?>
editform->display_footer(); ?> theme->get_boxContent2Footer(); ?> theme->get_boxButtonsBar($this->buttons); ?> theme->get_boxFooter(); ?> \ No newline at end of file diff --git a/plugin/module/Admin_GenericPetitionManager/html/admin_edit_signature.html.inc b/plugin/module/Admin_GenericPetitionManager/html/admin_edit_signature.html.inc index 2f3f17bb..c0a8d58f 100755 --- a/plugin/module/Admin_GenericPetitionManager/html/admin_edit_signature.html.inc +++ b/plugin/module/Admin_GenericPetitionManager/html/admin_edit_signature.html.inc @@ -1,101 +1,99 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericPetitionManager Module Admin Layout : edit_signature -*/ -global $camyks; -?> -theme->get_boxHeader('width:610px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle);?> -theme->get_boxContent2Header( )?> -editform->display_header(); ?> -editform->display_hiddens(); ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-get_translation('formitem_status')?> - -editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_signatureStatusList()));?> -
-get_translation('formitem_civility')?> - -editform->display_civilitySelectInput('title');?> -
-get_translation('formitem_lastname')?> - - editform->display_textInput('lastname');?> -
-get_translation('formitem_firstname')?> - - editform->display_textInput('firstname');?> -
-get_translation('formitem_email')?> - - editform->display_textInput('email');?> -
-get_translation('formitem_zipcode')?> - - editform->display_textInput('zipcode');?> -
-get_translation('formitem_city')?> - - editform->display_textInput('city');?> -
-get_translation('formitem_country')?> - - editform->display_countrySelectInput();?> -
-
- -editform->display_footer(); ?> -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Sep 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle);?> +theme->get_boxContent2Header(); ?> +editform->display_header(); ?> +editform->display_hiddens(); ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formitem_status'); ?> + + editform->display_selectInput(array('name'=>'status', 'values'=>$this->get_signatureStatusList()));?> +
+ get_translation('formitem_civility'); ?> + + editform->display_civilitySelectInput('title');?> +
+ get_translation('formitem_lastname'); ?> + + editform->display_textInput('lastname');?> +
+ get_translation('formitem_firstname'); ?> + + editform->display_textInput('firstname');?> +
+ get_translation('formitem_email'); ?> + + editform->display_textInput('email');?> +
+ get_translation('formitem_zipcode'); ?> + + editform->display_textInput('zipcode');?> +
+ get_translation('formitem_city'); ?> + + editform->display_textInput('city');?> +
+ get_translation('formitem_country'); ?> + + editform->display_countrySelectInput();?> +
+
+ +editform->display_footer(); ?> +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericPetitionManager/html/admin_list_sign.html.inc b/plugin/module/Admin_GenericPetitionManager/html/admin_list_sign.html.inc index f03abc6e..e425661c 100755 --- a/plugin/module/Admin_GenericPetitionManager/html/admin_list_sign.html.inc +++ b/plugin/module/Admin_GenericPetitionManager/html/admin_list_sign.html.inc @@ -1,27 +1,26 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericPetitionManager Module Admin Layout : list signature -*/ -global $camyks; -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->adminTitle) ?> -theme->get_boxContent1Header( )?> -signList->display('head');?> -theme->get_boxContent1Footer( )?> -theme->get_boxContent2Header( )?> -
-signList->display('list');?> -
-theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1 + * @date Creation: May 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->adminTitle); ?> +theme->get_boxContent1Header(); ?> +signList->display('head');?> +theme->get_boxContent1Footer(); ?> +theme->get_boxContent2Header(); ?> +
+ signList->display('list'); ?> +
+theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetition.php.inc b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetition.php.inc index 6e13afbf..aa5651b0 100755 --- a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetition.php.inc +++ b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetition.php.inc @@ -1,148 +1,149 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericPetitionManagerPetition object for Admin_GenericPetitionManager Module - */ - -class Admin_GenericPetitionManagerPetition extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericPetitionManagerPetition ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - /* content items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); - $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); - $this->add_newItem('description', 'db', 'text', 'text', '', '', true); - - /* temp items */ - $this->add_newItem('signs', 'temp', 'integer', '', '', ''); - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary method */ - - /* - * build sql condition for lists - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition($params) { - $search = array(); - if ( isset( $params['status'] ) and $params['status'] > -1 ) - $search[] = 'status='.$params['status']; - return implode(',', $search); - } - - /* specific tool methods */ - - /* - * return petitions status list - * @param boolean $full - * @return array - * @access public - */ - function get_multiStatusList($full=false) { - $list = array(); - if($full) - $list['-1'] = $this->get_translation('petitionsstatus_all'); - $list['0'] = $this->get_translation('petitionsstatus_disabled'); - $list['1'] = $this->get_translation('petitionsstatus_opened'); - $list['2'] = $this->get_translation('petitionsstatus_closed'); - return $list; - } - - /* - * return single petition status list - * @return array - * @access public - */ - function get_statusList() { - return array(0 => $this->get_translation('petitionstatus_disabled'), - 1 => $this->get_translation('petitionstatus_opened'), - 2 => $this->get_translation('petitionstatus_closed')); - } - - /* - * return petition list with given params - * @params array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - $p = array('status'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); - $params = array_merge($p, $params); - $w = $this->build_whereStatement($params); - return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); - } - - /* - * return petition title list with given params - * @params array $params - * @return array - * @access private - */ - function get_titleList($params=array()) { - global $camyks; - $p = array('status'=>-1); - $params = array_merge($p, $params); - $w = $this->build_whereStatement($params); - return $this->get_nameList('title', $w); - } - - /* - * return petition count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('status'=>-1); - $params = array_merge($p, $params); - return $this->get_objectCount($this->build_whereStatement($params)); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - /* check status */ - if ( is_string($params['status']) and $params['status'] != '') - $w[] = 'status '.$params['status']; - elseif($params['status'] != -1 ) - $w[] = 'status = '.$params['status']; - - return implode(' and ', $w); - } - - /* - * load signature count - * @return void - * @access private - */ - function get_signCount() { - $c = $this->_libParent->count_signsByPetitions(array($this->id)); - $this->vars['signs'] = isset($c[$this->id])?$c[$this->id]:0; - } -} -?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Sep 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericPetitionManagerPetition class. + */ +final class Admin_GenericPetitionManagerPetition extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Content attributes */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); + $this->add_newItem('title', 'db', 'text', 'varchar', 128, '', true); + $this->add_newItem('description', 'db', 'text', 'text', '', '', true); + + /* Temporary attributes */ + $this->add_newItem('signs', 'temp', 'integer', '', '', ''); + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary method */ + + /** + * Build sql condition for lists. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + $search = array(); + + if (isset($params['status']) and $params['status'] > -1) + $search[] = 'status='.$params['status']; + + return implode(',', $search); + } + + /* specific tool methods */ + + /** + * Return petitions status list. + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if($full) + $list['-1'] = $this->get_translation('petitionsstatus_all'); + $list['0'] = $this->get_translation('petitionsstatus_disabled'); + $list['1'] = $this->get_translation('petitionsstatus_opened'); + $list['2'] = $this->get_translation('petitionsstatus_closed'); + return $list; + } + + /** + * Return single petition status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('petitionstatus_disabled'), + 1 => $this->get_translation('petitionstatus_opened'), + 2 => $this->get_translation('petitionstatus_closed'), + ); + } + + /** + * Return petition list with given params. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + $p = array('status'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); + $params = array_merge($p, $params); + $w = $this->build_whereStatement($params); + return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); + } + + /** + * Return petition title list with given params. + * @param array $params + * @return array + */ + public function get_titleList($params=array()) { + global $camyks; + $p = array('status'=>-1); + $params = array_merge($p, $params); + $w = $this->build_whereStatement($params); + return $this->get_nameList('title', $w); + } + + /** + * Return petition count with given params. + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + $p = array('status'=>-1); + $params = array_merge($p, $params); + return $this->get_objectCount($this->build_whereStatement($params)); + } + + /** + * Build where statement from params. + * @param array $params + * @return string + */ + public function build_whereStatement($params=array()) { + $w = array(); + + /* Check status */ + if (is_string($params['status']) and $params['status'] != '') + $w[] = 'status '.$params['status']; + elseif($params['status'] != -1) + $w[] = 'status = '.$params['status']; + + return implode(' and ', $w); + } + + /** + * Load signature count. + * @return void + */ + public function get_signCount() { + $c = $this->_libParent->count_signsByPetitions(array($this->id)); + $this->vars['signs'] = isset($c[$this->id]) ? $c[$this->id] : 0; + } +} +?> diff --git a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetitionListParams.php.inc b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetitionListParams.php.inc index 395a042f..6d6245f1 100755 --- a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetitionListParams.php.inc +++ b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetitionListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericPetitionManager petition list parameters +/** + * @brief Admin_GenericPetitionManager Module petition list parameters + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Sep 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -26,25 +25,26 @@ $this->add_JSScript('var deletePetitionUrl="'.$this->get_adminJSLink(array('mode $this->petitionListParams = array('name'=>'petitionList', 'useSession'=>true, 'object'=>&$this->petitionItem, 'language'=>$this->language); /* build head parameters */ -$this->petitionListParams['headselectors'] = array('page'=> array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->petitionStatusList, 'default'=>'-1')); +$this->petitionListParams['headselectors'] = array( + 'page' => array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->petitionStatusList, 'default'=>'-1'), +); /* build sort parameters */ $this->petitionListParams['sort'] = array('allowed'=>false, 'default'=>'', 'defaultway'=>''); /* build column parameters */ -$this->petitionListParams['listcolumns'] = array('status'=>array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), - 'title'=>array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), - 'signs'=>array('title'=>$this->get_translation('signs'),'columntype'=>'text', 'style'=>'width:75px;'), - 'cdate'=>array('title'=>$this->get_translation('startedat'), 'columntype'=>'date', 'mode'=>'numeric', 'style'=>'width:75px')); - - -if ($this->check_right(2)==true ) { +$this->petitionListParams['listcolumns'] = array( + 'status' => array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), + 'title' => array('title'=>$camyks->get_translation('title'),'columntype'=>'text'), + 'signs' => array('title'=>$this->get_translation('signs'),'columntype'=>'text', 'style'=>'width:75px;'), + 'cdate' => array('title'=>$this->get_translation('startedat'), 'columntype'=>'date', 'mode'=>'numeric', 'style'=>'width:75px'), + 'list' =>array('title'=>' ', 'columntype'=>'button', 'icon'=>'file', 'url_value'=>$this->listSignatureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('listsignature')), +); + +if ($this->check_right(2)) { $this->petitionListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewpetition'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editPetitionLink, 0), 'titlecolumn'=>'title', 'buttoncolumn'=>'edit')); - $this->petitionListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editPetitionLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editpetition')); - $this->petitionListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deletePetitionLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletepetition')); - } - -$this->petitionListParams['listcolumns']['list'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'file', 'url_value'=>$this->listSignatureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('listsignature')); - -?> \ No newline at end of file + $this->petitionListParams['listcolumns']['edit'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editPetitionLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editpetition')); + $this->petitionListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deletePetitionLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletepetition')); +} +?> diff --git a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignature.php.inc b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignature.php.inc index 755a557b..4de71574 100755 --- a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignature.php.inc +++ b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignature.php.inc @@ -1,246 +1,232 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericPetitionManagerSignature object for Admin_GenericPetitionManager Module - */ - -class Admin_GenericPetitionManagerSignature extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_GenericPetitionManagerSignature ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - /* content items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('petition', 'db', 'date', 'bigint unsigned', '', 0); - $this->add_newItem('signdate', 'db', 'date', 'bigint unsigned', '', time()); - $this->add_newItem('title', 'db', 'text', 'varchar', 6, ''); - $this->add_newItem('firstname', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('lastname', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('email', 'db', 'text', 'varchar', 255, ''); - $this->add_newItem('address', 'db', 'text', 'varchar', 255, ''); - $this->add_newItem('zipcode', 'db', 'text', 'varchar', 12, ''); - $this->add_newItem('city', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('country', 'db', 'text', 'varchar', 3, ''); - $this->add_newItem('birthdate', 'db', 'date', 'bigint', '', time()); - - /* temp items */ - $this->add_newItem('confirm', 'temp', 'integer', '', '', 0); - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary methods */ - - /* - * check object data - * @return boolean success - * @access public - */ - function check_data() { - - /* check security code - if ( !isset($_REQUEST['secode'])) - return false; - $secode = $_REQUEST['secode']; - - - / set secure code - if( $this->id == 0 ) { - if ( $secode != substr(session_id(), 1, 8)) - return false; - } - */ - - /* check mandatory values */ - $this->_libItems['firstname']->value = trim($this->_libItems['firstname']->value); - if ($this->_libItems['firstname']->value == '' ) { - $this->_libError = $this->get_translation('error_firstnamemustbeset'); - return false; - } - - $this->_libItems['lastname']->value = trim($this->_libItems['lastname']->value); - if ($this->_libItems['lastname']->value == '' ) { - $this->_libError = $this->get_translation('error_lastnamemustbeset'); - return false; - } - - $this->_libItems['city']->value = trim($this->_libItems['city']->value); - if ($this->_libItems['city']->value == '' ) { - $this->_libError = $this->get_translation('error_citymustbeset'); - return false; - } - - $this->_libItems['zipcode']->value = trim($this->_libItems['zipcode']->value); - if ($this->_libItems['zipcode']->value == '' ) { - $this->_libError = $this->get_translation('error_zipcodemustbeset'); - return false; - } - - $this->_libItems['email']->value = trim($this->_libItems['email']->value); - if ($this->_libItems['email']->value == '' ) { - $this->_libError = $this->get_translation('error_emailmustbeset'); - return false; - } - - if (mail_isValidEmail($this->_libItems['email']->value) == false) { - $this->_libError = $this->get_translation('error_emailmustbevalid'); - return false; - } - return true; - } - - /* - * build sql condition for lists - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition($params) { - $where = array(); - - if ( isset( $_REQUEST['petition_id']) and $_REQUEST['petition_id']) - $where[] = 'petition = '.$_REQUEST['petition_id']; - - if ( isset( $params['status'] ) and $params['status'] > -1 ) - $where[] = 'status='.$params['status']; - return implode(' and ', $where); - } - - /* specific methods */ - - /* - * return categories status list - * @param boolean $full - * @return array - * @access public - */ - function get_multiStatusList($full=false) { - $list = array(); - if($full) - $list['-1'] = $this->get_translation('signaturesstatus_all'); - $list['0'] = $this->get_translation('signaturesstatus_disabled'); - $list['1'] = $this->get_translation('signaturesstatus_enabled'); - return $list; - } - - /* - * return single signature status list - * @return array - * @access public - */ - function get_statusList() { - return array(0 => $this->get_translation('signaturestatus_disabled'), - 1 => $this->get_translation('signaturestatus_enabled')); - } - - /* - * get signature count by petition - * @param array $petitions - * @return array - * @access public - */ - function count_byPetitions($petitions=null) { - global $camyks; - - $list = array(); - /* check petitions */ - if ( is_array($petitions) and count($petitions) == 0) - return $list; - - /* build sql query */ - $sql = 'select petition, count(id) as cnt from '.$this->_libSQLTable; - if ( is_array($petitions) and count($petitions)>0 ) - $sql .= ' where petition in ('.implode(',', $petitions).')'; - $sql .= ' group by petition'; - - /* execute sql query */ - if ( $req = mysql_query($sql) or $camyks->log_sqlerror( $this, $sql, __FILE__, __LINE__ ) ) - /* get data from database */ - while ( $data = mysql_fetch_assoc( $req )) - $list[$data['petition']] = $data['cnt']; - /* send results */ - return $list; - } - - /* - * return signature list with given params - * @params array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - $p = array('status'=>-1, 'petition'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); - $params = array_merge($p, $params); - $w = $this->build_whereStatement($params); - return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); - } - - /* - * return petition count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('status'=>-1); - $params = array_merge($p, $params); - return $this->get_objectCount($this->build_whereStatement($params)); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - /* check status */ - if ( is_string($params['status']) and $params['status'] != '') - $w[] = 'status '.$params['status']; - elseif($params['status'] != -1 ) - $w[] = 'status = '.$params['status']; - - /* check petition */ - if ( is_numeric($params['petition']) and $params['petition'] != -1) - $w[] = 'petition = '.$params['petition']; - elseif ( is_string($params['petition']) and $params['petition'] != '') - $w[] = 'petition '.$params['petition']; - elseif(is_array($params['petition'])) { - if (count($params['petition']) == 0 ) - return 'false'; - elseif(count($params['petition']) == 1) - $w[] = 'petition = '.$params['petition'][0]; - else - $w[] = 'petition in ('.implode(', ', $params['petition']).')'; - } - return implode(' and ', $w); - } - - /* - * save object from site - * @return success - * @access private - */ - function save_fromSite() { - $this->id = 0; - $this->get_fromHeader(); - $this->_libItems['status']->value = 1; - return $this->save(); - } -} -?> + + * @version 1.0.1 + * @date Creation: Sep 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GenericPetitionManagerSignature class. + */ +final class Admin_GenericPetitionManagerSignature extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Content attributes */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('petition', 'db', 'date', 'bigint unsigned', '', 0); + $this->add_newItem('signdate', 'db', 'date', 'bigint unsigned', '', time()); + $this->add_newItem('title', 'db', 'text', 'varchar', 6, ''); + $this->add_newItem('firstname', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('lastname', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('email', 'db', 'text', 'varchar', 255, ''); + $this->add_newItem('address', 'db', 'text', 'varchar', 255, ''); + $this->add_newItem('zipcode', 'db', 'text', 'varchar', 12, ''); + $this->add_newItem('city', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('country', 'db', 'text', 'varchar', 3, ''); + $this->add_newItem('birthdate', 'db', 'date', 'bigint', '', time()); + + /* Temporary attributes */ + $this->add_newItem('confirm', 'temp', 'integer', '', '', 0); + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary methods */ + + /** + * Check object data. + * @return boolean success + */ + public function check_data() { + /* Check mandatory values */ + $this->_libItems['firstname']->value = trim($this->_libItems['firstname']->value); + if ($this->_libItems['firstname']->value == '') { + $this->_libError = $this->get_translation('error_firstnamemustbeset'); + return false; + } + + $this->_libItems['lastname']->value = trim($this->_libItems['lastname']->value); + if ($this->_libItems['lastname']->value == '') { + $this->_libError = $this->get_translation('error_lastnamemustbeset'); + return false; + } + + $this->_libItems['city']->value = trim($this->_libItems['city']->value); + if ($this->_libItems['city']->value == '') { + $this->_libError = $this->get_translation('error_citymustbeset'); + return false; + } + + $this->_libItems['zipcode']->value = trim($this->_libItems['zipcode']->value); + if ($this->_libItems['zipcode']->value == '') { + $this->_libError = $this->get_translation('error_zipcodemustbeset'); + return false; + } + + $this->_libItems['email']->value = trim($this->_libItems['email']->value); + if ($this->_libItems['email']->value == '') { + $this->_libError = $this->get_translation('error_emailmustbeset'); + return false; + } + + if (mail_isValidEmail($this->_libItems['email']->value) == false) { + $this->_libError = $this->get_translation('error_emailmustbevalid'); + return false; + } + return true; + } + + /** + * Build sql condition for lists. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + $where = array(); + + if (isset($_REQUEST['petition_id']) and $_REQUEST['petition_id'] > 0) + $where[] = 'petition = '.(int)$_REQUEST['petition_id']; + + if (isset($params['status']) and $params['status'] > -1) + $where[] = 'status='.$params['status']; + + return implode(' and ', $where); + } + + /* Specific methods */ + + /** + * Return categories status list. + * @param boolean $full + * @return array + */ + public function get_multiStatusList($full=false) { + $list = array(); + if($full) + $list['-1'] = $this->get_translation('signaturesstatus_all'); + $list['0'] = $this->get_translation('signaturesstatus_disabled'); + $list['1'] = $this->get_translation('signaturesstatus_enabled'); + return $list; + } + + /** + * Return single signature status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('signaturestatus_disabled'), + 1 => $this->get_translation('signaturestatus_enabled'), + ); + } + + /** + * Return signature count by petition. + * @param array $petitions + * @return array + */ + public function count_byPetitions($petitions=null) { + global $camyks; + + $list = array(); + + /* Check petitions */ + if (is_array($petitions) and count($petitions) == 0) + return $list; + + /* Build SQL query */ + $sql = 'select petition, count(id) as cnt from '.$this->_libSQLTable; + if (is_array($petitions) and count($petitions)>0) + $sql .= ' where petition in ('.implode(',', $petitions).')'; + $sql .= ' group by petition'; + + /* Execute SQL query */ + if ($this->execute_DBQuery($sql, __LINE__)) + while ($data = $this->get_DBQueryDataLine()) + $list[$data['petition']] = $data['cnt']; + + /* Return results */ + return $list; + } + + /** + * Return signature list with given params. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + $p = array('status'=>-1, 'petition'=>-1, 'limit'=>-1, 'count'=>-1, 'order'=>'id', 'orderway'=>''); + $params = array_merge($p, $params); + $w = $this->build_whereStatement($params); + return $this->get_objectList($camyks->current_language, $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); + } + + /** + * Return petition count with given params + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + $p = array('status'=>-1, 'petition'=>-1); + $params = array_merge($p, $params); + return $this->get_objectCount($this->build_whereStatement($params)); + } + + /** + * Build where statement from params. + * @param array $params + * @return string + */ + private function build_whereStatement($params=array()) { + $w = array(); + + /* Check status */ + if (is_string($params['status']) and $params['status'] != '') + $w[] = 'status '.$params['status']; + elseif($params['status'] != -1) + $w[] = 'status = '.$params['status']; + + /* Check petition */ + if (is_numeric($params['petition']) and $params['petition'] != -1) + $w[] = 'petition = '.$params['petition']; + elseif (is_string($params['petition']) and $params['petition'] != '') + $w[] = 'petition '.$params['petition']; + elseif(is_array($params['petition'])) { + if (count($params['petition']) == 0) + return 'false'; + elseif(count($params['petition']) == 1) + $w[] = 'petition = '.$params['petition'][0]; + else + $w[] = 'petition in ('.implode(', ', $params['petition']).')'; + } + return implode(' and ', $w); + } + + /** + * Save object from site. + * @return success + */ + public function save_fromSite() { + $this->id = 0; + $this->get_fromHeader(); + $this->_libItems['status']->value = 1; + return $this->save(); + } +} +?> diff --git a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignatureListParams.php.inc b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignatureListParams.php.inc index e363df00..cf0b49a3 100755 --- a/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignatureListParams.php.inc +++ b/plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignatureListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Sep 2010 - * Last Modif Date : Sep 2010 - * - * Admin_GenericPetitionManager signature list parameters +/** + * @brief Admin_GenericPetitionManager Module signature list parameters + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Sep 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -29,8 +28,10 @@ $this->signatureListParams = array('name'=>'signatureList', 'useSession'=>true, $this->signatureListParams['headhiddens'] = array('petition_id'=>$this->petitionItem->id); /* build head parameters */ -$this->signatureListParams['headselectors'] = array('page'=> array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->signatureStatusList, 'default'=>'-1')); +$this->signatureListParams['headselectors'] = array( + 'page' => array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->signatureStatusList, 'default'=>'-1'), +); /* build sort parameters */ $this->signatureListParams['sort'] = array('allowed'=>true, 'default'=>'signdate', 'defaultway'=>'desc'); @@ -38,10 +39,12 @@ $this->signatureListParams['sort'] = array('allowed'=>true, 'default'=>'signdate /* build column parameters */ //$this->signatureListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewsignature'), 'icon'=>'plus', 'url_value'=>vsprintf($this->editSignatureLink, 0), 'titlecolumn'=>'title', 'buttoncolumn'=>'edit')); -$this->signatureListParams['listcolumns'] = array('status'=>array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), - 'lastname'=>array('title'=>$this->get_translation('signatory'),'columntype'=>'specialtext', 'text'=>'%s %s', 'vars'=>array('firstname', 'lastname')), - 'city'=>array('title'=>$this->get_translation('location'), 'columntype'=>'specialtext', 'text'=>'%s(%s)', 'vars'=>array('city', 'zipcode')), - 'signdate'=>array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numericwithhour'), - 'edit'=>array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editSignatureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editsignature')), - 'delete'=>array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteSignatureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletesignature'), 'condition'=>'is_deletable')); -?> \ No newline at end of file +$this->signatureListParams['listcolumns'] = array( + 'status' => array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), + 'lastname' => array('title'=>$this->get_translation('signatory'),'columntype'=>'specialtext', 'text'=>'%s %s', 'vars'=>array('firstname', 'lastname')), + 'city' => array('title'=>$this->get_translation('location'), 'columntype'=>'specialtext', 'text'=>'%s(%s)', 'vars'=>array('city', 'zipcode')), + 'signdate' => array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numericwithhour'), + 'edit' => array('title'=>' ', 'columntype'=>'button', 'icon'=>'edit', 'url_value'=>$this->editSignatureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('editsignature')), + 'delete' => array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteSignatureLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletesignature'), 'condition'=>'is_deletable'), +); +?> diff --git a/plugin/module/Admin_GenericPetitionManager/locale/translation_fr.php.inc b/plugin/module/Admin_GenericPetitionManager/locale/translation_fr.php.inc index 63bcfea2..1c58e08f 100755 --- a/plugin/module/Admin_GenericPetitionManager/locale/translation_fr.php.inc +++ b/plugin/module/Admin_GenericPetitionManager/locale/translation_fr.php.inc @@ -1,16 +1,15 @@ - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Jul 2010 - * Last Modif Date : Jul 2010 - * - * Admin_GenericPetitionManager french dictionnary -*/ +/** + * @brief Admin_GenericPetitionManager Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jul 2010 + * @date Modification: Jan 2021 + * @copyright 2010 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_genericpetitionmanager_title'] = 'Pétitions'; $this->trads['mod_admin_genericpetitionmanager_desc'] = 'Gestion des pétitions'; diff --git a/plugin/module/Admin_GlobalHelp/Admin_GlobalHelp.php.inc b/plugin/module/Admin_GlobalHelp/Admin_GlobalHelp.php.inc index cbc37af7..0d9c1513 100755 --- a/plugin/module/Admin_GlobalHelp/Admin_GlobalHelp.php.inc +++ b/plugin/module/Admin_GlobalHelp/Admin_GlobalHelp.php.inc @@ -1,261 +1,278 @@ - - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Fev 2007 - * Last Modif Date : Mar 2008 - * History : - * * 07-02-xx : Initial files - * - * TO DO : - * - get site help files - * - */ - -class Admin_GlobalHelp extends Module { - /* variables */ - var $mode; - - /* list mode vars */ - var $list; - var $help; - var $htitle; - - /* dislay mode vars */ - var $hfile; - var $location; - var $layout; - var $helpfile; - - /* - * constructor - * @param string $path_type - */ - function Admin_GlobalHelp ( $path_type ) { - parent::Module('Admin_GlobalHelp', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'helpers'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Default'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - } - - /* overwrite Module methods */ - - /* - * get rights - * @return void - * @access private - */ - function get_rights ( ) { - global $camyks; - $this->rights[0] = array( 'name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> true); - } - - /* - * init object when in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - /* check read rights */ - if ( $this->check_right(0) === false ) { - return $this->init_admin_accessDenied(); - } - - /* get header values */ - $this->mode = isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'list'; - - /* get action ton execute case of mode */ - switch ( $this->mode ) { - case 'display': - /* get header values */ - $this->location = isset ( $_REQUEST['location'] ) ? $_REQUEST['location'] : ''; - $this->hfile = isset ( $_REQUEST['hfile'] ) ? $_REQUEST['hfile'] : ''; - - /* check if given values are set */ - if ( $this->location == '' or $this->hfile == '' ) { - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->text = $this->get_translation('nohelpfound'); - $this->set_redirect(4, $camyks->get_adminLink($this->name)); - break; - } - - /* button list for buttons bars */ - $this->buttons = array(array('title'=>$camyks->get_translation('back'), - 'link'=>$camyks->get_adminLink( $this->name, array()))); - - /* check if given value correspond to a help file */ - if ($this->location == 'engine' and $this->check_engineHelpFile ( $this->hfile )) { - $this->help_path = $camyks->camyks_engine_path.'/help/'.$this->hfile.'/'.$camyks->current_language.'/'; - $this->selected_layout = 'display_engine.html.inc'; - $this->add_JSEngineFile('object/cmdd.js'); - $this->add_JSScript(strtolower($this->name).'_helpObject = new Cmdd();' ); - $this->add_JSScript(strtolower($this->name).'_helpObject.init("'.$this->name. - '", "","'.$camyks->theme->parts['boxTabCSSStandart']. - '","'.$camyks->theme->parts['boxTabCSSSelected']. - '","'.$camyks->theme->parts['boxTabCSSRollover'].'");' ); - - foreach ( $this->help as $i => $v ) { - $this->add_JSLoadScript(strtolower($this->name).'_helpObject.mouseclick(\''.$i.'\');'); - break; - } - - } else if ($this->location == 'modules' and $this->check_modulesHelpFile ( $this->hfile )) { - $this->help_path = $camyks->modules[$this->hfile]->plugin_path.'/help/'.$camyks->current_language.'/'; - $this->selected_layout = 'display_modules.html.inc'; - } else if ($this->location == 'site' and $this->check_siteHelpFile ( $this->hfile )) { - $this->help_path = ''; - $this->selected_layout = 'display_modules.html.inc'; - } else { - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->text = $this->get_translation('nohelpfound'); - $this->set_redirect(4, $camyks->get_adminLink($this->name)); - break; - } - break; - case 'list': - default: - $this->list = array(); - /* get engine list */ - $this->get_engineHelpList(); - /* get module list */ - $this->get_modulesHelpList(); - /* get site list */ - $this->get_siteHelpList(); - $this->selected_layout = 'list.html.inc'; - /* button list for buttons bars */ - $this->buttons = array(array('title'=>$camyks->get_translation('back'), - 'link'=>$camyks->get_adminLink())); - break; - } - /* generic module admin initialisation */ - parent::init_admin(); - } - - /* - * display object when in admin part - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* specific tool methods */ - - /* - * check engine help folder - * @return void - * @access private - */ - function get_engineHelpList ( ) { - global $camyks; - $this->list['engine'] = array(); - $folder = $camyks->camyks_engine_path.'/help'; - - /* start listing folders */ - if ( $dir = opendir( $folder ) ) { - $folders = array(); - while ( ( $file = readdir ( $dir ) ) !== false ) { - if ( ( $file != '.') and ( $file != '..' ) and ( is_dir( $folder.'/'.$file ) ) ) { - if ( file_exists( $folder.'/'.$file.'/'.$camyks->current_language.'/help.php.inc' ) ){ - require $folder.'/'.$file.'/'.$camyks->current_language.'/help.php.inc'; - $this->list['engine'][$file] = array ( 'title' => $this->htitle, - 'link'=>$camyks->get_adminLink($this->name, array('mode'=>'display', 'location'=>'engine', 'hfile'=>$file))); - } - } - } - } - } - - /* - * check modules help folder - * @return void - * @access private - */ - function get_modulesHelpList ( ) { - global $camyks; - $this->list['modules'] = array(); - $hfile = 'help/'.$camyks->current_language.'/help.php.inc'; - - foreach ( $camyks->modules as $n => $m ) { - $m->load_file( $hfile ); - if ( $m->help != null ) { - $this->list['modules'][$n]=array('title' => $m->title, - 'link'=>$camyks->get_adminLink($this->name, array('mode'=>'display', - 'location'=>'modules', - 'hfile'=>$n))); - } - } - } - - /* - * check site help folder - * @return void - * @access private - */ - function get_siteHelpList ( ) { - global $camyks; - $this->list['site'] = array(); - } - - /* - * check engine help - * @return void - * @access private - */ - function check_engineHelpFile ( $name ) { - global $camyks; - if ( file_exists( $camyks->camyks_engine_path.'/help/'.$name.'/'.$camyks->current_language.'/help.php.inc') ) { - require $camyks->camyks_engine_path.'/help/'.$name.'/'.$camyks->current_language.'/help.php.inc'; - return true; - } - return false; - } - - /* - * check modules help - * @return void - * @access private - */ - function check_modulesHelpFile ( $name ) { - global $camyks; - if ( !isset($camyks->modules[$name])) - return false; - - $camyks->modules[$name]->get_help(); - $camyks->modules[$name]->init_parent_admin(); - - $this->help = $camyks->modules[$name]->help; - if ( $this->help != null ) { - return true; - } - return false; - } - - /* - * check site help - * @return void - * @access private - */ - function check_siteHelpFile ( $name ) { - /* TO DO */ - } -} -?> \ No newline at end of file + Displays help for all plugins. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Fev 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GlobalHelp class. + */ +final class Admin_GlobalHelp extends Module { + /** + * var array $list + * @brief List of available help files. + */ + protected $list; + + /** + * var mixed $help + * @brief Link to help files. + */ + public $help; + + /** + * var string $htitle + * @brief Help files title. + */ + protected $htitle; + + /** + * var string $hfile + * @brief Help files name to display. + */ + protected $hfile; + + /** + * var string $location + * @brief Help files location to display. + */ + protected $location; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_GlobalHelp', $path_type); + + /* Override Plugin variables */ + $this->plugin_package = 'Default'; + $this->version = '1.0'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'helpers'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + } + + /* Override Module methods */ + + /** + * Define plugin permissions. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => true + ); + } + + /** + * Initialise object when in admin mode + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check read permission */ + if ($this->check_right(0) === false) { + return $this->init_admin_accessDenied(); + } + + /* Load mode to execute */ + $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'list'; + + /* Execute action */ + switch ($this->mode) { + case 'display': + /* Load header values */ + $this->location = isset ($_REQUEST['location']) ? $_REQUEST['location'] : ''; + $this->hfile = isset ($_REQUEST['hfile']) ? $_REQUEST['hfile'] : ''; + + /* Check if given values are set */ + if ($this->location == '' or $this->hfile == '') { + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->text = $this->get_translation('nohelpfound'); + $this->set_redirect(4, $this->get_adminLink()); + break; + } + + /* Build button list */ + $this->buttons = array(array( + 'title' => $camyks->get_translation('back'), + 'link' => $this->get_adminLink(), + )); + + /* Check if given value correspond to a help file */ + if ($this->location == 'engine' and $this->check_engineHelpFile($this->hfile)) { + $this->help_path = $camyks->camyks_engine_path.'/help/'.$this->hfile.'/'.$camyks->current_language.'/'; + $this->set_selectedLayout('display_engine.html.inc'); + $this->add_JSEngineFile('object/cmdd.js'); + $this->add_JSScript(strtolower($this->name).'_helpObject = new Cmdd();'); + $this->add_JSScript(strtolower($this->name).'_helpObject.init("'.$this->name. + '", "","'.$camyks->theme->parts['boxTabCSSStandart']. + '","'.$camyks->theme->parts['boxTabCSSSelected']. + '","'.$camyks->theme->parts['boxTabCSSRollover'].'");'); + + foreach ($this->help as $i => $v) { + $this->add_JSLoadScript(strtolower($this->name).'_helpObject.mouseclick(\''.$i.'\');'); + break; + } + + } else if ($this->location == 'modules' and $this->check_modulesHelpFile ($this->hfile)) { + $this->help_path = $camyks->modules[$this->hfile]->plugin_path.'/help/'.$camyks->current_language.'/'; + $this->set_selectedLayout('display_modules.html.inc'); + } else if ($this->location == 'site' and $this->check_siteHelpFile ($this->hfile)) { + $this->help_path = ''; + $this->set_selectedLayout('display_modules.html.inc'); + } else { + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->text = $this->get_translation('nohelpfound'); + $this->set_redirect(4, $this->get_adminLink()); + break; + } + break; + case 'list': + default: + $this->list = array(); + + /* Load engine help list */ + $this->get_engineHelpList(); + + /* Load module help list */ + $this->get_modulesHelpList(); + + /* Load site help list */ + $this->get_siteHelpList(); + $this->set_selectedLayout('list.html.inc'); + + /* Build button list */ + $this->buttons = array(array( + 'title' => $camyks->get_translation('back'), + 'link' => $camyks->get_adminLink(), + )); + break; + } + + /* Perform generic module */ + parent::init_admin(); + } + + /* Specific tool methods */ + + /** + * Load engine help files. + * @return void + */ + private function get_engineHelpList() { + global $camyks; + + /* Initialise variables */ + $this->list['engine'] = array(); + $folder = $camyks->camyks_engine_path.'/help'; + + /* Build list */ + if ($dir = @opendir($folder)) { + $folders = array(); + while (($file = readdir ($dir)) !== false) { + if (($file != '.') and ($file != '..') and (is_dir($folder.'/'.$file))) { + if (file_exists($folder.'/'.$file.'/'.$camyks->current_language.'/help.php.inc')) { + require $folder.'/'.$file.'/'.$camyks->current_language.'/help.php.inc'; + $this->list['engine'][$file] = array( + 'title' => $this->htitle, + 'link' => $this->get_adminLink(array('mode'=>'display', 'location'=>'engine', 'hfile'=>$file)), + ); + } + } + } + } + } + + /** + * Load modules help files. + * @return void + */ + private function get_modulesHelpList() { + global $camyks; + + /* Initialise variables */ + $this->list['modules'] = array(); + $hfile = 'help/'.$camyks->current_language.'/help.php.inc'; + + foreach ($camyks->modules as $n => $m) { + $m->load_file($hfile); + if ($m->help != null) { + $this->list['modules'][$n] = array( + 'title' => $m->title, + 'link' => $this->get_adminLink(array('mode'=>'display', 'location'=>'modules', 'hfile'=>$n)), + ); + } + } + } + + /** + * Load site help files. + * @return void + */ + private function get_siteHelpList() { + global $camyks; + $this->list['site'] = array(); + /* TO DO */ + } + + /** + * Check engine help files. + * @return void + */ + private function check_engineHelpFile($name) { + global $camyks; + if (file_exists($camyks->camyks_engine_path.'/help/'.$name.'/'.$camyks->current_language.'/help.php.inc')) { + require $camyks->camyks_engine_path.'/help/'.$name.'/'.$camyks->current_language.'/help.php.inc'; + return true; + } + return false; + } + + /** + * Check modules help files. + * @return void + */ + private function check_modulesHelpFile($name) { + global $camyks; + if (!isset($camyks->modules[$name])) + return false; + + $camyks->modules[$name]->get_help(); + $camyks->modules[$name]->init_parent_admin(); + $this->help = &$camyks->modules[$name]->help; + + if ($this->help != null) + return true; + return false; + } + + /** + * Check site help. + * @return void + */ + private function check_siteHelpFile($name) { + /* TO DO */ + } +} +?> diff --git a/plugin/module/Admin_GlobalHelp/html/display_engine.html.inc b/plugin/module/Admin_GlobalHelp/html/display_engine.html.inc index 37316ff4..74f17c18 100755 --- a/plugin/module/Admin_GlobalHelp/html/display_engine.html.inc +++ b/plugin/module/Admin_GlobalHelp/html/display_engine.html.inc @@ -1,50 +1,55 @@ - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Fev 2007 - * Last Modif Date : Fev 2008 - * - * Admin_GlobalHelp Module Layout : display -*/ +/** + * @brief Admin_GlobalHelp Module admin display engine help layout. + * @details Plugin / Module layout + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Fev 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * @cond Exclude + */ global $camyks; ?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar( $this->title );?> -theme->get_boxContent2Header();?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxContent2Header(); ?>
- - -help ) > 1 ) : ?> - - - -
- - help as $i => $v ) : ?> - - - - -
-
-
- help as $i => $v ) : ?> - - -
+ + + help) > 1) : ?> + + + + +
+ + help as $i => $v) : ?> + + + + +
+ +
+
+ help as $i => $v) : ?> + + +
-theme->get_boxContent2Footer();?> -theme->get_boxButtonsBar($this->buttons);?> -theme->get_boxFooter( );?> \ No newline at end of file +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> + \ No newline at end of file diff --git a/plugin/module/Admin_GlobalHelp/html/display_modules.html.inc b/plugin/module/Admin_GlobalHelp/html/display_modules.html.inc index 6a451f4b..f760a77e 100755 --- a/plugin/module/Admin_GlobalHelp/html/display_modules.html.inc +++ b/plugin/module/Admin_GlobalHelp/html/display_modules.html.inc @@ -1,24 +1,29 @@ - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Fev 2007 - * Last Modif Date : Fev 2008 - * - * Admin_GlobalHelp Module Layout : display -*/ +/** + * @brief Admin_GlobalHelp Module admin display module help layout. + * @details Plugin / Module layout + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Fev 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * @cond Exclude + */ global $camyks; ?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxContent2Header();?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxContent2Header(); ?>
-modules[$this->hfile]->display_help() ?> + modules[$this->hfile]->display_help(); ?>
-theme->get_boxContent2Footer();?> -theme->get_boxButtonsBar( $this->buttons );?> -theme->get_boxFooter( );?> +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> + diff --git a/plugin/module/Admin_GlobalHelp/html/list.html.inc b/plugin/module/Admin_GlobalHelp/html/list.html.inc index 1bdb121a..7c5c29b4 100755 --- a/plugin/module/Admin_GlobalHelp/html/list.html.inc +++ b/plugin/module/Admin_GlobalHelp/html/list.html.inc @@ -1,18 +1,14 @@ - * CaMykS Version : 1.0a2 - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Fev 2007 - * Last Modif Date : Mar 2009 - * - * Admin_GlobalHelp Module Layout : list -*/ - /** + * @brief Admin_GlobalHelp Module admin list layout. + * @details Plugin / Module layout + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Fev 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @cond Exclude */ global $camyks; @@ -20,134 +16,123 @@ global $camyks; $view = $this->theme->get_pictURL('view', 12, 'std'); $view_ = $this->theme->get_pictURL('view', 12, 'ovr'); ?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar( $this->title );?> -theme->get_boxContent2Header();?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxContent2Header(); ?>
- -list['engine'] ) > 0 ) : ?> - - - - - - -list['engine'] as $e ) : ?> - - - - - - - - - - -list['modules'] ) > 0 ) : ?> - - - - - +
-   - - get_translation('withengine', $camyks->title)?> - -   -
-   - - - - - - - <?=$this->get_translation('viewhelp');?> - -
-   -
-   - - get_translation ('withmodules')?> - -   -
+ list['engine']) > 0) : ?> + + + + + + + list['engine'] as $e) : ?> + + + + + + + + + + + + list['modules']) > 0) : ?> + + + + + - -list['modules'] as $e ) : ?> - - - - - - - - - - - -list['site'] ) > 0 ) : ?> - - - - - - -list['site'] as $e ) : ?> - - - - - - - -
+   + + get_translation('withengine', $camyks->title)?> + +   +
+   + + + + + + <?= $this->get_translation('viewhelp'); ?> + +
+   +
+   + + get_translation('withmodules')?> + +   +
-   - - - - - - - <?=$this->get_translation('viewhelp');?> - -
-   -
-   - - get_translation ('withsite')?> - -   -
-   - - - - - - - <?=$this->get_translation('viewhelp');?> - -
+ + list['modules'] as $e) : ?> + + +   + + + + + + + + <?= $this->get_translation('viewhelp'); ?> + + + + + + + +   + + + + list['site']) > 0) : ?> + + +   + + + get_translation('withsite')?> + + +   + + + + list['site'] as $e) : ?> + + +   + + + + + + + + <?= $this->get_translation('viewhelp'); ?> + + + + + +
-theme->get_boxContent2Footer();?> -theme->get_boxButtonsBar($this->buttons);?> -theme->get_boxFooter( );?> -theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> + - * CaMykS Version : 1.0a2 - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Mar 2009 - * Last Modif Date : Mar 2009 - * - * Admin_GlobalHelp module english dictionnary -*/ +/** + * @brief Admin_GlobalHelp Module english dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Mar 2009 + * @date Modification: Jan 2021 + * @copyright 2009 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_globalhelp_title'] = 'Global Help'; $this->trads['mod_admin_globalhelp_desc'] = 'Display help files'; -/* tabs titles */ + $this->trads['mod_admin_globalhelp_withengine'] = 'Help files available with %s'; $this->trads['mod_admin_globalhelp_withmodules'] = 'Help files available with modules.'; $this->trads['mod_admin_globalhelp_withsite'] = 'Help files available with website'; diff --git a/plugin/module/Admin_GlobalHelp/locale/translation_fr.php.inc b/plugin/module/Admin_GlobalHelp/locale/translation_fr.php.inc index 3468c708..59c2d549 100755 --- a/plugin/module/Admin_GlobalHelp/locale/translation_fr.php.inc +++ b/plugin/module/Admin_GlobalHelp/locale/translation_fr.php.inc @@ -1,19 +1,18 @@ - * CaMykS Version : 1.0a2 - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Fev 2007 - * Last Modif Date : Mar 2009 - * - * Admin_GlobalHelp module french dictionnary -*/ +/** + * @brief Admin_GlobalHelp Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Fev 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_globalhelp_title'] = 'Aide Globale'; -$this->trads['mod_admin_globalhelp_desc'] = 'Affiche les aides'; -/* tabs titles */ +$this->trads['mod_admin_globalhelp_desc'] = 'Affiche les aides disponibles'; + $this->trads['mod_admin_globalhelp_withengine'] = 'Aides disponibles avec %s'; $this->trads['mod_admin_globalhelp_withmodules'] = 'Aides disponibles avec les modules'; $this->trads['mod_admin_globalhelp_withsite'] = 'Aides disponibles avec le site'; diff --git a/plugin/module/Admin_GoogleTools/Admin_GoogleTools.php.inc b/plugin/module/Admin_GoogleTools/Admin_GoogleTools.php.inc index 37e86376..97bcf6a5 100755 --- a/plugin/module/Admin_GoogleTools/Admin_GoogleTools.php.inc +++ b/plugin/module/Admin_GoogleTools/Admin_GoogleTools.php.inc @@ -1,212 +1,222 @@ - - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Sep 2007 - * Last Modif Date : Oct 2008 - * History : - * * 07-09-xx : Initial files - * * 08-04-14 : Update regexp to support result values larger than a thousand - * * 08-04-15 : Update Google page loader - * * 08-10-21 : Update Google page parser - * - * Admin_GoogleTools Module - * Some tools based on Google engine - */ - -class Admin_GoogleTools extends Module { - /* variables */ - var $referredpages; - var $maxreferredpages; - - var $linkedpages; - var $maxlinkedpages; - - /* - * constructor - * @param string $path_type - */ - function Admin_GoogleTools ( $path_type ) { - parent::Module('Admin_GoogleTools', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'monitoring'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Google'; - /* set plugin author */ - $this->authors_name = 'CaMykS Team'; - $this->authors_mail = 'camyks.contact@gmail.com'; - $this->authors_group = 'camyks.net'; - /* initialise some variables */ - $this->maxreferredpages = 100; - $this->maxlinkedpages = 100; - } - - /* overwrite Module methods */ - - /* - * initialise module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - /* if user has no rights for this module, make redirection to home */ - if ( $this->check_right(0) === false ) { - return $this->init_admin_accessDenied(); - } - - /* get informations */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : '' ); - - switch ( $this->mode ) { - case 'referred': - $this->init_admin_referred(); - break; - case 'linked': - $this->init_admin_linked(); - break; - default: - $this->openTab = 'referred'; - } - - /* get tab engine */ - $this->tabObject = 'gtools_tabObject'; - $this->add_JSEngineFile('object/ctab.js'); - $this->add_JSScript($this->tabObject.' = new CTab();'); - $this->add_JSScript($this->tabObject.'.init("referred", "' - .$this->theme->parts['boxTabCSSStandart'].'","' - .$this->theme->parts['boxTabCSSSelected'].'","' - .$this->theme->parts['boxTabCSSRollover'].'");'); - $this->add_JSLoadScript($this->tabObject.'.mouseclick(\''.$this->openTab.'\');'); - - $this->tabs = array(array('name'=>'referred', - 'title'=>$this->get_translation('tabreferred')), - array('name'=>'linked', - 'title'=>$this->get_translation('tablinked'))); - - /* get buttons */ - $this->buttons = array(array('link'=>$camyks->get_adminLink(), - 'title'=>$camyks->get_translation('back'))); - parent::init_admin(); - } - - /* - * display module object in admin mode - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* - * set module rights - * @return void - * @access private - */ - function get_rights ( ) { - global $camyks; - $this->rights[0] = array( 'name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> false); - } - - /* specific methods */ - - /* - * initialise module object in admin/referred mode - * @return void - * @access private - */ - function init_admin_referred() { - global $camyks; - $this->openTab = 'referred'; - - $this->referredpages = array(); - $this->referredpages['count'] = 0; - $this->referredpages['list'] = array(); - - $url = $camyks->_conf['url']; - $find = '@^(?:http://)?([^/]+)@i'; - if ( preg_match( $find, $url, $result ) ) - $url = $result[1]; - - $gurl = 'http://www.google.com/search?hl=en&num='.$this->maxreferredpages; - $gurl .= '&btnG=Google+Search&as_sitesearch='.urlencode($url); - $gurl .= '&ie=utf-8&oe=utf-8'; - - /* get google page */ - $handle = @fopen( $gurl, 'rb'); - $content = stream_get_contents($handle); - fclose($handle); - - /* parse count result in page */ - if ( preg_match ('/about ([0-9,\ ]*)<\/b> from/', - $content, - $count ) ) { - $this->referredpages['count'] = (int)preg_replace('/[^0-9]/', '', $count[1]); - } - - /* parse list result in page */ - if ( preg_match_all('/]*>]*>([^<]*)<\/a><\/h/i', - $content, - $list ) ) { - foreach ( $list[0] as $i=>$result ) { - $r = array ('title'=> $list[2][$i], 'url'=> $list[1][$i] ); - $this->referredpages['list'][] = $r; - } - } - } - - /* - * initialise module object in admin/linked mode - * @return void - * @access private - */ - function init_admin_linked() { - global $camyks; - $this->openTab = 'linked'; - - $this->linkedpages = array(); - $this->linkedpages['count'] = 0; - $this->linkedpages['list'] = array(); - - $url = $camyks->site_conf['url']; - $find = '@^(?:http://)?([^/]+)@i'; - if ( preg_match( $find, $url, $result ) ) - $url = $result[1]; - - $gurl = 'http://www.google.com/search?hl=en&q=link%3A'.urlencode($url).'&btnG=Search'; - $gurl .= '&ie=utf-8&oe=utf-8&num='.$this->maxlinkedpages; - - /* get google page */ - $handle = @fopen( $gurl, 'rb'); - $content = stream_get_contents($handle); - fclose($handle); - - /* parse count result in page */ - if ( preg_match('/ ([0-9,\ ]*)<\/b> linking/', - $content, - $count ) ) { - $this->linkedpages['count'] = (int)preg_replace('/[^0-9]/', '', $count[1]); - } - - /* parse list result in page */ - if ( preg_match_all('/]*>]*>([^<]*)<\/a><\/h/i', - $content, - $list ) ) { - foreach ( $list[0] as $i=>$result ) { - $r = array ('title'=> $list[2][$i], 'url'=> $list[1][$i] ); - $this->linkedpages['list'][] = $r; - } - } - } -} -?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Sep 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_GoogleTools class. + */ +final class Admin_GoogleTools extends Module { + /** + * var array $referredpages + * @brief List of refered pages. + */ + protected $referredpages; + + /** + * var integer $maxreferredpages + * @brief Default max referred pages loaded. + */ + private $maxreferredpages = 100; + + /** + * var array $linkedpages + * @brief List of linked pages. + */ + protected $linkedpages; + + /** + * var integer $maxlinkedpages + * @brief Default mex linked pages loaded + */ + private $maxlinkedpages = 100; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_GoogleTools', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'Google'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'monitoring'; + + /* Define plugin author */ + $this->authors_name = 'CaMykS Team'; + $this->authors_mail = 'camyks.contact@gmail.com'; + $this->authors_group = 'camyks.net'; + } + + /* Override Module methods */ + + /** + * Define module permission. + * @return void + */ + function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => false, + ); + } + + /** + * Initialise module object in admin mode + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check admin user permission */ + if ($this->check_right(0) === false) { + return $this->init_admin_accessDenied(); + } + + /* Load action to execute */ + $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : ''; + + /* Execute action */ + switch ($this->mode) { + case 'referred': + $this->init_admin_referred(); + break; + case 'linked': + $this->init_admin_linked(); + break; + default: + $this->openTab = 'referred'; + } + + /* Load tab engine */ + $this->tabObject = 'gtools_tabObject'; + $this->add_JSEngineFile('object/ctab.js'); + $this->add_JSScript($this->tabObject.' = new CTab();'); + $this->add_JSScript($this->tabObject.'.init("referred", "' + .$this->theme->parts['boxTabCSSStandart'].'","' + .$this->theme->parts['boxTabCSSSelected'].'","' + .$this->theme->parts['boxTabCSSRollover'].'");'); + $this->add_JSLoadScript($this->tabObject.'.mouseclick(\''.$this->openTab.'\');'); + + $this->tabs = array( + array( + 'name' => 'referred', + 'title' => $this->get_translation('tabreferred'), + ), + array( + 'name' => 'linked', + 'title' => $this->get_translation('tablinked'), + ), + ); + + /* Build buttons */ + $this->buttons = array( + array( + 'link' => $camyks->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + ); + + /* Perform generic initialisation */ + parent::init_admin(); + } + + /* Specific admin methods */ + + /** + * Initialise module object in admin/referred mode. + * @return void + */ + private function init_admin_referred() { + global $camyks; + + $this->openTab = 'referred'; + + $this->referredpages = array(); + $this->referredpages['count'] = 0; + $this->referredpages['list'] = array(); + + $url = $camyks->_conf['url']; + $find = '@^(?:http://)?([^/]+)@i'; + if (preg_match($find, $url, $result) ) + $url = $result[1]; + + $gurl = 'http://www.google.com/search?hl=en&num='.$this->maxreferredpages; + $gurl .= '&btnG=Google+Search&as_sitesearch='.urlencode($url); + $gurl .= '&ie=utf-8&oe=utf-8'; + + /* get google page */ + $handle = @fopen($gurl, 'rb'); + $content = stream_get_contents($handle); + fclose($handle); + + /* parse count result in page */ + if (preg_match ('/about ([0-9,\ ]*)<\/b> from/', $content, $count)) { + $this->referredpages['count'] = (int)preg_replace('/[^0-9]/', '', $count[1]); + } + + /* parse list result in page */ + if (preg_match_all('/]*>]*>([^<]*)<\/a><\/h/i', $content, $list)) { + foreach ($list[0] as $i=>$result) { + $r = array ('title'=> $list[2][$i], 'url'=> $list[1][$i]); + $this->referredpages['list'][] = $r; + } + } + } + + /** + * Initialise module object in admin/linked mode. + * @return void + */ + private function init_admin_linked() { + global $camyks; + + $this->openTab = 'linked'; + + $this->linkedpages = array(); + $this->linkedpages['count'] = 0; + $this->linkedpages['list'] = array(); + + $url = $camyks->site_conf['url']; + $find = '@^(?:http://)?([^/]+)@i'; + if (preg_match($find, $url, $result) ) + $url = $result[1]; + + $gurl = 'http://www.google.com/search?hl=en&q=link%3A'.urlencode($url).'&btnG=Search'; + $gurl .= '&ie=utf-8&oe=utf-8&num='.$this->maxlinkedpages; + + /* get google page */ + $handle = @fopen($gurl, 'rb'); + $content = stream_get_contents($handle); + fclose($handle); + + /* parse count result in page */ + if (preg_match('/ ([0-9,\ ]*)<\/b> linking/', $content, $count)) { + $this->linkedpages['count'] = (int)preg_replace('/[^0-9]/', '', $count[1]); + } + + /* parse list result in page */ + if (preg_match_all('/]*>]*>([^<]*)<\/a><\/h/i', $content, $list)) { + foreach ($list[0] as $i=>$result) { + $r = array ('title'=> $list[2][$i], 'url'=> $list[1][$i]); + $this->linkedpages['list'][] = $r; + } + } + } +} +?> diff --git a/plugin/module/Admin_GoogleTools/html/admin.html.inc b/plugin/module/Admin_GoogleTools/html/admin.html.inc index 9f16b3df..3eda889a 100755 --- a/plugin/module/Admin_GoogleTools/html/admin.html.inc +++ b/plugin/module/Admin_GoogleTools/html/admin.html.inc @@ -1,165 +1,134 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Sep 2007 - * Last Modif Date : Sep 2007 - * - * Admin_GoogleTools Module Admin Layout -*/ -global $camyks; - -$view = $this->theme->get_pictURL('view', 12, 'std' ); -$view_ = $this->theme->get_pictURL('view', 12, 'ovr' ); - -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar ( $this->title ) ?> -theme->get_boxTabsBar ( $this->tabs, - $this->tabObject.'.mouseclick', - $this->tabObject.'.mouseover', - $this->tabObject.'.mouseout', - 'referred');?> -theme->get_boxContent2Header( )?> -
- - - -referredpages ) ) : ?> - - - - - -referredpages['count'] > $this->maxreferredpages ) : ?> - - - - - -referredpages['count'] > 0 ) : ?> - - - - - - - - -referredpages['list'] as $page ) : ?> - - - - - - - - - - - - - - - - - - - - - - -
-get_translation('referredpagescountresult', $this->referredpages['count'])?> -
-get_translation('referredpagesfirstresult', $this->maxreferredpages ) ?> -
-get_translation('referredpageslistresult' ) ?> -
- - - - - - - -
-get_translation('referreddesc');?> -
- theme->get_button($camyks->get_translation('search'), - $camyks->get_adminLink($this->name).'&mode=referred')?> -
-
- - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar( $this->buttons ); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Sep 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; + +$view = $this->theme->get_pictURL('view', 12, 'std'); +$view_ = $this->theme->get_pictURL('view', 12, 'ovr'); +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabs, $this->tabObject.'.mouseclick', $this->tabObject.'.mouseover', $this->tabObject.'.mouseout', 'referred'); ?> +theme->get_boxContent2Header(); ?> + +
+ + referredpages)) : ?> + + + + + referredpages['count'] > $this->maxreferredpages) : ?> + + + + referredpages['count'] > 0) : ?> + + + + + + + referredpages['list'] as $page) : ?> + + + + + + + + + + + + + + + +
+ get_translation('referredpagescountresult', $this->referredpages['count']); ?> +
+ get_translation('referredpagesfirstresult', $this->maxreferredpages); ?> +
+ get_translation('referredpageslistresult'); ?> +
+ + + + + + + +
+ get_translation('referreddesc'); ?> +
+ theme->get_button($camyks->get_translation('search'), $camyks->get_adminLink($this->name).'&mode=referred'); ?> +
+
+ + + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_GoogleTools/locale/translation_fr.php.inc b/plugin/module/Admin_GoogleTools/locale/translation_fr.php.inc index 247d4840..0b16b1e6 100755 --- a/plugin/module/Admin_GoogleTools/locale/translation_fr.php.inc +++ b/plugin/module/Admin_GoogleTools/locale/translation_fr.php.inc @@ -1,16 +1,15 @@ - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Sep 2007 - * Last Modif Date : Sep 2007 - * - * Admin_GoogleTools language dictionnary : French -*/ +/** + * @brief Admin_GoogleTools Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Sep 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_googletools_title'] = 'Outils Google'; $this->trads['mod_admin_googletools_desc'] = 'Pages référencées, liens, ...'; @@ -29,4 +28,4 @@ $this->trads['mod_admin_googletools_linkeddesc'] = 'Cette fonction vous permet d $this->trads['mod_admin_googletools_linkedpagescountresult'] = 'Google référence actuellement %s page(s) poitant vers votre site.'; $this->trads['mod_admin_googletools_linkedpageslistresult'] = 'Ces pages sont :'; $this->trads['mod_admin_googletools_linkedpagesfirstresult'] = 'Les %s premières pages sont :'; -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_LanguageChecker/Admin_LanguageChecker.php.inc b/plugin/module/Admin_LanguageChecker/Admin_LanguageChecker.php.inc index da220c98..6a7fa444 100755 --- a/plugin/module/Admin_LanguageChecker/Admin_LanguageChecker.php.inc +++ b/plugin/module/Admin_LanguageChecker/Admin_LanguageChecker.php.inc @@ -1,207 +1,219 @@ - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Create Date : Nov 2006 - * Last Modif Date : Sep 2007 - * - * Admin_LanguageChecker Module - * Help developers to compare dictionnary files from plugins +/** + * @brief Admin_LanguageChecker Module + *
Development module to check missing locales. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Nov 2006 + * @date Modification: Jan 2021 + * @copyright 2006 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -class Admin_LanguageChecker extends Module { - /* variables */ - var $action; - var $locales; - var $langs; - var $list; - var $items; - var $prefix; - var $defaultTab; - - /* - * constructor - * @param string $path_type - */ - function Admin_LanguageChecker ($path_type) { - parent::Module('Admin_LanguageChecker', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'devel'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Development'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* module values */ - $this->libs[] = 'Admin_LanguageCheckerEngine.php.inc'; - - /* init */ - $this->get_PHPLibs(); - } - - /* overwrite Module methods */ - - /* - * set module rights - * @return void - * @access private - */ - function get_rights () { - global $camyks; - $this->rights[0] = array('name'=>'read', - 'title'=>$camyks->get_translation('read'), - 'default'=>false); - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - /* check access right */ - if ($this->check_right(0) === false) { - return $this->init_admin_accessDenied(); - } +/** + * Admin_LanguageChecker class. + */ +final class Admin_LanguageChecker extends Module { + /* variables */ + var $locales; + var $langs; + var $list; + var $items; + var $prefix; + var $defaultTab; - /* check action to execute */ - $this->action = (isset($_REQUEST['action'])?$_REQUEST['action']:'list'); - switch ($this->action) { - case 'checker' : - $this->init_admin_checker(); - break; - case 'list' : - default : - $this->init_admin_list(); - break; - } - parent::init_admin(); - } - - /* specific mode methods */ - - /* - * init module object in admin/checker mode - * @return void - * @access private - */ - function init_admin_checker () { - global $camyks; - $this->locales = array(); - $view = $_REQUEST['view']; - $type = $_REQUEST['type']; - $this->items = array(); - - /* load folder */ - if ($type == 'engine' and $view == 'camyks') { - $folder = $camyks->camyks_engine_path.'/locale'; - } else if ($type == 'engine') { - $folder = $camyks->camyks_engine_path.'/locale/'.$view; - } else if ($type == 'module') { - $folder = $camyks->modules[$view]->plugin_path.'/locale'; - } else if ($type == 'input') { - $folder = $camyks->inputs[$view]->plugin_path.'/locale'; - } - - /* load available languages for folder */ - $languages = array_merge($camyks->get_confValue('editing_languages'), language_getDictionnaryList($folder)); - - foreach ($languages as $language) { - $this->locales[$language] = new Admin_LanguageCheckerEngine ($folder, $language); - - /* get all items */ - foreach ($this->locales[$language]->trads as $item => $value) { - if (!in_array($item, $this->items)) { - $this->items[] = $item; - } - } - } - - /* sort items */ - sort($this->items); - - /* get prefix */ - foreach ($this->items as $i) { - $this->prefix = $i; - break; - } - foreach ($this->items as $i) { - $this->prefix = string_getSimilarBeginning($i, $this->prefix); - } - - /* get default tab */ - $this->defaultTab = ''; - foreach ($this->locales as $l=>$v) { - $this->defaultTab = 'lang'.$l; - break; + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_LanguageChecker', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'Development'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'devel'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load library */ + $this->load_library('Admin_LanguageCheckerEngine'); } - - /* load tab engine */ - $this->tabObject = 'admin_languagechecker_tabObject'; - $this->add_JSEngineFile('object/ctab.js'); - $this->add_JSScript($this->tabObject.' = new CTab();'); - $this->add_JSScript($this->tabObject.'.init("'.$this->defaultTab.'", "' - .$camyks->theme->parts['boxTabCSSStandart'].'", "' - .$camyks->theme->parts['boxTabCSSSelected'].'", "' - .$camyks->theme->parts['boxTabCSSRollover'].'");'); - - /* get tabs */ - $this->tabs = array(); - foreach ($this->locales as $l => $v) { - $this->tabs[] = array ('name' => 'lang'.$l, - 'title' => language_getIcon($l)); + + /* Override Module methods */ + + /** + * Define module permissions + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => false, + ); } - /* get buttons */ - $this->buttons = array(array('title'=>$camyks->get_translation('back'), - 'link'=>$this->get_adminLink())); - - /* update layout */ - $this->selected_layout = 'checker.html.inc'; - } - - /* - * init module object in admin/list mode - * @return void - * @access private - */ - function init_admin_list () { - global $camyks; - $this->list = array(); - - /* add camyks global locales */ - $this->list['camyks'] = array('type'=>'engine', 'title' => 'CaMykS'); - - /* add camyks dedicated locales */ - $folders = folder_listFolders($camyks->camyks_engine_path.'/locale'); - foreach ($folders as $folder) - $this->list[$folder] = array('type'=>'engine', 'title' => ' / '.$folder); - - /* add modules */ - foreach ($camyks->modules as $m) { - $this->list[$m->name] = array('type'=>'module', 'title' => $m->title); + /** + * Initialise module object in admin mode. + * @return void + */ + public function init_admin() { + /* Check user permission */ + if ($this->check_right(0) === false) { + return $this->init_admin_accessDenied(); + } + + /* Load action to execute */ + $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'list'; + + /* Execute action */ + switch ($this->mode) { + case 'checker' : + $this->init_admin_checker(); + break; + case 'list' : + default : + $this->init_admin_list(); + break; + } + + /* Perform generic initalisation */ + parent::init_admin(); } - /* add inputs */ - foreach ($camyks->inputs as $m) { - $this->list[$m->name] = array('type'=>'input', 'title' => $m->name); + /* Specific admin mode methods */ + + /** + * Initialise module object in admin/checker mode. + * @return void + */ + private function init_admin_checker() { + global $camyks; + + /* Initialise variables */ + $this->locales = array(); + $view = $_REQUEST['view']; + $type = $_REQUEST['type']; + $this->items = array(); + + /* Load folder */ + if ($type == 'engine' and $view == 'camyks') { + $folder = $camyks->camyks_engine_path.'/locale'; + } else if ($type == 'engine') { + $folder = $camyks->camyks_engine_path.'/locale/'.$view; + } else if ($type == 'module') { + $folder = $camyks->modules[$view]->plugin_path.'/locale'; + } else if ($type == 'input') { + $folder = $camyks->inputs[$view]->plugin_path.'/locale'; + } + + /* Load available languages for folder */ + $languages = array_merge($camyks->get_confValue('editing_languages'), language_getDictionnaryList($folder)); + + foreach ($languages as $language) { + $this->locales[$language] = new Admin_LanguageCheckerEngine($folder, $language); + + /* Build item list */ + foreach ($this->locales[$language]->trads as $item => $value) { + if (!in_array($item, $this->items)) { + $this->items[] = $item; + } + } + } + + /* Sort items */ + sort($this->items); + + /* get prefix */ + foreach ($this->items as $i) { + $this->prefix = $i; + break; + } + foreach ($this->items as $i) { + $this->prefix = string_getSimilarBeginning($i, $this->prefix); + } + + /* Load default tab */ + $this->defaultTab = ''; + foreach ($this->locales as $l=>$v) { + $this->defaultTab = 'lang'.$l; + break; + } + + /* Load tab engine */ + $this->tabObject = 'admin_languagechecker_tabObject'; + $this->add_JSEngineFile('object/ctab.js'); + $this->add_JSScript($this->tabObject.' = new CTab();'); + $this->add_JSScript($this->tabObject.'.init("'.$this->defaultTab.'", "'.$camyks->theme->parts['boxTabCSSStandart'].'", "'.$camyks->theme->parts['boxTabCSSSelected'].'", "'.$camyks->theme->parts['boxTabCSSRollover'].'");'); + + /* Build tabs */ + $this->tabs = array(); + foreach ($this->locales as $l => $v) { + $this->tabs[] = array( + 'name' => 'lang'.$l, + 'title' => language_getIcon($l), + ); + } + + /* Build interface buttons */ + $this->buttons = array( + array( + 'title' => $camyks->get_translation('back'), + 'link' => $this->get_adminLink(), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('checker.html.inc'); } - /* get buttons */ - $this->buttons = array(array('title'=>$camyks->get_translation('back'), - 'link'=>$camyks->get_adminLink())); + /** + * Initialise module object in admin/list mode + * @return void + */ + private function init_admin_list() { + global $camyks; + $this->list = array(); + + /* Add camyks global locales */ + $this->list['camyks'] = array('type'=>'engine', 'title' => 'CaMykS'); + + /* Add camyks dedicated locales */ + $folders = folder_listFolders($camyks->camyks_engine_path.'/locale'); + foreach ($folders as $folder) + $this->list[$folder] = array('type'=>'engine', 'title' => ' / '.$folder); - /* update layout */ - $this->selected_layout = 'list.html.inc'; - } + /* Add modules */ + foreach ($camyks->modules as $m) { + $this->list[$m->name] = array('type'=>'module', 'title' => $m->title); + } + + /* Add inputs */ + foreach ($camyks->inputs as $m) { + $this->list[$m->name] = array('type'=>'input', 'title' => $m->name); + } + + /* Build interface buttons */ + $this->buttons = array( + array( + 'title' => $camyks->get_translation('back'), + 'link' => $camyks->get_adminLink(), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('list.html.inc'); + } } -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_LanguageChecker/html/checker.html.inc b/plugin/module/Admin_LanguageChecker/html/checker.html.inc index dafc741c..ae13953f 100755 --- a/plugin/module/Admin_LanguageChecker/html/checker.html.inc +++ b/plugin/module/Admin_LanguageChecker/html/checker.html.inc @@ -1,58 +1,55 @@ - - * Camyks Version : 1.0 - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Nov 2006 - * Last Modif Date : Jan 2018 - * - * Admin_LanguageChecker Module Layout : checker -*/ -global $camyks; -?> -theme->get_boxHeader(array('class'=>'adminEditorModule', 'style'=>'width:600px; margin:0 auto;'));?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxTabsBar($this->tabs, - $this->tabObject.'.mouseclick', - $this->tabObject.'.mouseover', - $this->tabObject.'.mouseout', - $this->defaultTab);?> -theme->get_boxContent2Header();?> -locales as $l=>$v) : ?> -
- - - - - - - items as $item ) : ?> - - - trads[$item] ) ) : ?> - - - - - - - -
- get_translation('item')?> - - get_translation('value')?> -
- prefix), strlen($item))?> - - trads[$item]?> - - get_translation('unset');?> -
-
- -theme->get_boxContent2Footer();?> -theme->get_boxButtonsBar($this->buttons);?> -theme->get_boxFooter();?> \ No newline at end of file + + * @version 1.0.0 + * @date Creation: Nov 2006 + * @date Modification: Jan 2021 + * @copyright 2006 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabs, $this->tabObject.'.mouseclick', $this->tabObject.'.mouseover', $this->tabObject.'.mouseout', $this->defaultTab); ?> +theme->get_boxContent2Header(); ?> +locales as $l=>$v) : ?> +
+ + + + + + + + items as $item) : ?> + + + trads[$item])) : ?> + + + + + + + +
+ get_translation('item'); ?> + + get_translation('value'); ?> +
+ prefix), strlen($item)); ?> + + trads[$item]; ?> + + get_translation('unset'); ?> +
+
+ +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> + diff --git a/plugin/module/Admin_LanguageChecker/html/list.html.inc b/plugin/module/Admin_LanguageChecker/html/list.html.inc index 3def1b38..cf410447 100755 --- a/plugin/module/Admin_LanguageChecker/html/list.html.inc +++ b/plugin/module/Admin_LanguageChecker/html/list.html.inc @@ -1,37 +1,35 @@ - - * CaMykS Version : 1.0 - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Nov 2006 - * Last Modif Date : Jan 2018 - * - * Admin_LanguageChecker Module Layout : list -*/ -global $camyks; -?> -theme->get_boxHeader(array('class'=>'adminEditorModule', 'style'=>'width:600px; margin:0 auto;'));?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxContent1Header();?> -
- - - list as $l => $v) :?> - - - - - -
- - get_translation($v['type'], $v['title'])?> - -
-
-theme->get_boxContent1Footer();?> -theme->get_boxButtonsBar($this->buttons);?> -theme->get_boxFooter();?> - \ No newline at end of file + + * @version 1.0.0 + * @date Creation: Nov 2006 + * @date Modification: Jan 2021 + * @copyright 2006 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule', 'style'=>'width:600px; margin:0 auto;')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxContent1Header(); ?> +
+ + + list as $l => $v) :?> + + + + + +
+ + get_translation($v['type'], $v['title']); ?> + +
+
+theme->get_boxContent1Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_LanguageChecker/lib/Admin_LanguageCheckerEngine.php.inc b/plugin/module/Admin_LanguageChecker/lib/Admin_LanguageCheckerEngine.php.inc index bcb9a41c..e6451030 100755 --- a/plugin/module/Admin_LanguageChecker/lib/Admin_LanguageCheckerEngine.php.inc +++ b/plugin/module/Admin_LanguageChecker/lib/Admin_LanguageCheckerEngine.php.inc @@ -1,42 +1,52 @@ - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Create Date : Nov 2006 - * Last Modif Date : Sep 2007 - * - * Admin_LanguageCheckerEngine library for Admin_LanguageChecker module +/** + * @brief Admin_LanguageChecker Module, engine library. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Nov 2006 + * @date Modification: Jan 2021 + * @copyright 2006 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -class Admin_LanguageCheckerEngine { - /* variables */ - var $hasfile; - var $trads; +/** + * Admin_LanguageCheckerEngine class. + */ +final class Admin_LanguageCheckerEngine { + /** + * var boolean $hasfile + * @brief Has language file. + */ + public $hasfile; + + /** + * var array $trads + * @brief Locale list. + */ + public $trads; + + /** + * Class constructor. + * @param string $folder + * @param string $locale + * @return void + */ + public function __construct($folder, $locale) { + global $camyks; - /* - * constructor - * @param string $type - * @param string $item - * @param string $locale - */ - function Admin_LanguageCheckerEngine ($folder, $locale) { - global $camyks; - - /* build file full path */ - $file = $folder.'/translation_'.$locale.$camyks->file_extension; + /* Build file full path */ + $file = $folder.'/translation_'.$locale.$camyks->file_extension; - /* load trad */ - $this->trads = array(); - if (file_exists ($file)) { - $this->hasfile = true; - require ($file); - } else { - $this->hasfile = false; + /* Load locales */ + $this->trads = array(); + if (file_exists($file)) { + $this->hasfile = true; + require ($file); + } else { + $this->hasfile = false; + } } - } } -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_LanguageChecker/locale/translation_fr.php.inc b/plugin/module/Admin_LanguageChecker/locale/translation_fr.php.inc index 30af0c35..d1e1c1de 100755 --- a/plugin/module/Admin_LanguageChecker/locale/translation_fr.php.inc +++ b/plugin/module/Admin_LanguageChecker/locale/translation_fr.php.inc @@ -1,17 +1,15 @@ - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Create Date : Nov 2006 - * Last Modif Date : Sep 2007 - * - * Admin_LanguageChecker language dictionnary : French +/** + * @brief Admin_LanguageChecker Input french dictionnary + * @details Plugin / Input Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Nov 2006 + * @date Modification: Jan 2021 + * @copyright 2006 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - $this->trads['mod_admin_languagechecker_title'] = 'Vérificateur de langue'; $this->trads['mod_admin_languagechecker_desc'] = 'Permet de comparer les fichiers de localisation'; @@ -22,4 +20,4 @@ $this->trads['mod_admin_languagechecker_input'] = 'Input %s'; $this->trads['mod_admin_languagechecker_item'] = 'Élément'; $this->trads['mod_admin_languagechecker_value'] = 'Valeur'; $this->trads['mod_admin_languagechecker_unset'] = 'Non défini'; -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_MessagePanel/Admin_MessagePanel.php.inc b/plugin/module/Admin_MessagePanel/Admin_MessagePanel.php.inc deleted file mode 100755 index e25bace7..00000000 --- a/plugin/module/Admin_MessagePanel/Admin_MessagePanel.php.inc +++ /dev/null @@ -1,237 +0,0 @@ - - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Create Date : Apr 2007 - * Last Modif Date : May 2008 - * History : - * * 07-04-xx : Initial files - * * 08-05-28 : Disable admin menu for data I/O modes - * - * Admin_MessagePanel module - * Display admin users messages - */ - -class Admin_MessagePanel extends Module { - /* variables */ - var $message; - var $messages; - - /* - * constructor - * @param string $path_type - */ - function Admin_MessagePanel ( $path_type ) { - parent::Module('Admin_MessagePanel', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'helpers'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Default'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - /* load libs */ - $this->libs[] = 'Admin_MessagePanelItem.php.inc'; - $this->get_PHPLibs(); - $this->message = new Admin_MessagePanelItem( 0, $this ); - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - if ( $this->message->install( ) ) { - return parent::install(); - } - return false; - } - - /* - * uninstall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - return $this->message->uninstall(); - } - - /* - * check if module installation - * @return boolean result - * @access private - */ - function is_installed ( ) { - return $this->message->is_installed(); - } - - /* - * set module object rights - * @return void - * @access private - */ - function get_rights ( ) { - global $camyks; - $this->rights[0] = array( 'name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> true); - $this->rights[1] = array( 'name'=>'write', - 'title'=> $camyks->get_translation('write'), - 'default'=> true); - } - - /* - * update description in Control Panel Module - * @return void - * @access private - */ - function get_adminControlPanelAction( ) { - global $camyks; - $date = $this->message->get_lastObjectDate(); - if ( date_isSameDay ( $date ) ) { - $camyks->trads['mod_admin_messagepanel_desc'] = - vsprintf($camyks->trads['mod_admin_messagepanel_desc_hour'], strftime('%H:%M', $date)); - } else { - $camyks->trads['mod_admin_messagepanel_desc'] = - vsprintf($camyks->trads['mod_admin_messagepanel_desc_date'], date_displayQuickDate($date)); - } - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - /* check access right */ - if ( $this->check_right(0) === false ) { - return $this->init_admin_accessDenied(); - } - - /* get module mode */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'view' ); - - /* get action to execute case of mode */ - switch ( $this->mode ) { - case 'save': - /* mode == save */ - $this->init_admin_save(); - break; - case 'view': - default: - /* mode == view */ - $this->init_admin_view(); - break; - } - parent::init_admin(); - } - - /* - * init module object in display mode - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* specific admin mode methods */ - - /* - * init module object in admin/list mode - * @return void - * @access private - */ - function init_admin_view ( ) { - global $camyks; - /* message list */ - $this->messages = $this->message->get_objectlist(false, - '', - 0, - 20, - 'creation_date', - 'desc'); - /* message to edit */ - $this->message->id = isset( $_REQUEST['messageid'] ) ? $_REQUEST['messageid'] : 0 ; - $this->message->get(); - $this->message->get_fromItems(); - - /* get form */ - $this->form = new HTMLForm( 'admin_messagepanel_form', - $camyks->get_adminLink( $this->name, array('mode'=>'save')), - 'POST'); - $this->form->add_hidden('messageid', $this->message->id); - if ( $this->message->id > 0 ) { - $this->form->add_hidden('creation_date', $this->message->vars['creation_date'] ); - $this->form->add_hidden('user', $this->message->vars['user'] ); - } else { - $this->form->add_hidden('user', $camyks->adminUser->login ); - } - - /* get tabs engine */ - $this->openTab = isset($_REQUEST['openTab']) ? $_REQUEST['openTab'] : 'list'; - $this->tabObject = 'admin_messagepanel_tabObject'; - $this->add_JSEngineFile('object/ctab.js'); - $this->add_JSScript($this->tabObject.' = new CTab();'); - $this->add_JSScript($this->tabObject.'.init("list", "' - .$camyks->theme->parts['boxTabCSSStandart'].'","' - .$camyks->theme->parts['boxTabCSSSelected'].'","' - .$camyks->theme->parts['boxTabCSSRollover'].'");'); - if ( $this->openTab != 'list' ) - $this->add_JSLoadScript($this->tabObject.'.mouseclick("'.$this->openTab.'");'); - - /* get tabs */ - $this->tabs = array(array('name'=>'list', - 'title'=>$this->get_translation('tablist'))); - if ( $this->check_right(1)===true ) { - $this->tabs[] = array('name'=>'form', - 'title'=>$this->get_translation('tab'.($this->message->id==0?'new':'edit'))); - } - - /* get buttons */ - $this->buttons = array(array('title'=>$camyks->get_translation('back'), - 'link' =>$camyks->get_adminLink())); - } - - /* - * init module object in admin/save mode - * @return void - * @access private - */ - function init_admin_save ( ) { - global $camyks; - /* check edit items rights */ - if ( $this->check_right(1) === false ) { - return $this->init_admin_actionNotAllowed(); - } - - /* disable admin menus */ - $this->disable_adminEngineMenus(); - - /* get item data */ - $this->message->id = isset ( $_REQUEST['messageid'] ) ? $_REQUEST['messageid'] : 0; - $this->message->get_fromHeader(); - if ( $this->message->save() ) { - $this->text = $camyks->get_translation('savedone'); - } else { - $this->text = $camyks->get_translation('savefailed'); - } - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect ( 4, $camyks->get_adminLink($this->name, array('mode'=>'list'))); - } -} -?> \ No newline at end of file diff --git a/plugin/module/Admin_MessagePanel/html/admin.html.inc b/plugin/module/Admin_MessagePanel/html/admin.html.inc deleted file mode 100755 index c66ea0fd..00000000 --- a/plugin/module/Admin_MessagePanel/html/admin.html.inc +++ /dev/null @@ -1,100 +0,0 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Apr 2007 - * Last Modif Date : Apr 2007 - * - * Admin_MessagePanel Module Admin Layout : message list - */ -global $camyks; -/* get imgs url */ -$edit = $camyks->theme->get_pictURL('edit', 12, 'std'); -$edit_ = $camyks->theme->get_pictURL('edit', 12, 'ovr'); -$del = $camyks->theme->get_pictURL('cross', 12, 'std'); -$del_ = $camyks->theme->get_pictURL('cross', 12, 'ovr'); -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxTabsBar($this->tabs, - $this->tabObject.'.mouseclick', - $this->tabObject.'.mouseover', - $this->tabObject.'.mouseout', - 'list');?> -theme->get_boxContent2Header();?> -
- - messages as $message ) : ?> - - - - - - - - - - - -
- get_translation('listfromat', array( $message->vars['user'], - date_displayLongFormat($message->vars['creation_date'])))?> - - vars['user'] == $camyks->adminUser->login ) : ?> - - - - -   - -
- vars['content']) ?> -
-   -
-
- - -theme->get_boxContent2Footer();?> -theme->get_boxButtonsBar( $this->buttons );?> -theme->get_boxFooter();?> diff --git a/plugin/module/Admin_MessagePanel/lib/Admin_MessagePanelItem.php.inc b/plugin/module/Admin_MessagePanel/lib/Admin_MessagePanelItem.php.inc deleted file mode 100755 index ff688b06..00000000 --- a/plugin/module/Admin_MessagePanel/lib/Admin_MessagePanelItem.php.inc +++ /dev/null @@ -1,70 +0,0 @@ - - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Lib - * Creation Date : Apr 2007 - * Last Modif Date : Apr 2007 - * - * Admin_MessagePanelItem object for Admin_MessagePanel Module - */ - -class Admin_MessagePanelItem extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_MessagePanelItem ( $id, &$module ) { - global $camyks; - parent::ModuleLibrary ( $id, $module ); - /* content */ - $this->add_newItem('title', 'db', 'text', 'varchar', 128, ''); - $this->add_newItem('creation_date', 'db', 'date', 'bigint', '', time()); - $this->add_newItem('user', 'db', 'text', 'varchar', 16, ''); - $this->add_newItem('content', 'db', 'text', 'text', '', ''); - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary methods */ - - /* - * check object data - * @return boolean result - * @access public - */ - function check_data() { - if ( trim( $this->_libItems['title']->value ) == '' - or trim ( $this->_libItems['content']->value ) == '' ) { - return false; - } - return true; - } - - /* specific tool methods */ - - /* - * return database last object date value - * no param - * return date - */ - function get_lastObjectDate ( ) { - global $camyks; - /* build sql query */ - $sql = 'select creation_date'; - $sql .= ' from '.$this->_libSQLTable; - $sql .= ' order by creation_date desc'; - $sql .= ' limit 1'; - /* execute sql query */ - if ( $req = mysql_query($sql) or $camyks->log_sqlerror( $this, $sql, __FILE__, __LINE__ ) ) - /* return data from database */ - if ( $data = mysql_fetch_assoc( $req ) ) - return $data['creation_date']; - return 0; - } -} -?> \ No newline at end of file diff --git a/plugin/module/Admin_MessagePanel/locale/translation_fr.php.inc b/plugin/module/Admin_MessagePanel/locale/translation_fr.php.inc deleted file mode 100755 index 5b2e71ed..00000000 --- a/plugin/module/Admin_MessagePanel/locale/translation_fr.php.inc +++ /dev/null @@ -1,31 +0,0 @@ - - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Apr 2007 - * Last Modif Date : Apr 2007 - * - * Admin_MessagePanel language dictionnary : French - */ - -$this->trads['mod_admin_messagepanel_title'] = 'Tableau de messages'; -$this->trads['mod_admin_messagepanel_desc'] = '--'; -$this->trads['mod_admin_messagepanel_desc_hour'] = 'Dernier message à %s.'; -$this->trads['mod_admin_messagepanel_desc_date'] = 'Dernier message le %s.'; - -/* admin tabs */ -$this->trads['mod_admin_messagepanel_tablist'] = 'Messages'; -$this->trads['mod_admin_messagepanel_tabnew'] = 'Ajouter un message'; -$this->trads['mod_admin_messagepanel_tabedit'] = 'Modifier un message'; - -/* admin list mode */ -$this->trads['mod_admin_messagepanel_listfromat'] = 'Par %s le %s.'; - -/* admin form mode */ -$this->trads['mod_admin_messagepanel_formtitle'] = 'Titre'; -$this->trads['mod_admin_messagepanel_formmessage'] = 'Message'; -?> \ No newline at end of file diff --git a/plugin/module/Admin_MyMessages/Admin_MyMessages.php.inc b/plugin/module/Admin_MyMessages/Admin_MyMessages.php.inc index 27879c64..dcd4d3e7 100755 --- a/plugin/module/Admin_MyMessages/Admin_MyMessages.php.inc +++ b/plugin/module/Admin_MyMessages/Admin_MyMessages.php.inc @@ -1,329 +1,331 @@ - - * CamykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Create Date : Jun 2007 - * Last Modif Date : May 2008 - * History : - * * 07-06-xx : Initial files - * * 08-05-28 : Disable admin menu for data I/O mode - * - * Admin_MyMessages module - * Internal Message System Module - */ - -class Admin_MyMessages extends Module { - /* variables */ - var $maxmessages; - var $message; - - /* - * constructor - * @param string $path_type - */ - function Admin_MyMessages ( $path_type ) { - parent::Module('Admin_MyMessages', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'personal'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Default'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* load plugin libraries */ - $this->libs[] = 'Admin_InternalMessage.php.inc'; - $this->get_PHPLibs(); - - /* get plugin libraries */ - $this->message = new Admin_InternalMessage(0, $this); - - /* initialise some variables */ - $this->maxmessages = 20; - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - if ( $this->message->install() ) - Return parent::install(); - return false; - } - - /* - * uninstall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - return $this->message->uninstall(); - } - - /* - * check module installation - * @return boolean result - * @access private - */ - function is_installed () { - return $this->message->is_installed(); - } - - /* - * get module rights - * @return void - * @access private - */ - function get_rights() { - global $camyks; - $this->rights[0] = array('name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> true); - $this->rights[1] = array('name'=>'write', - 'title'=> $camyks->get_translation('write'), - 'default'=> true); - } - - /* - * update description in control panel - * @return void - * @access private - */ - function get_adminControlPanelAction ( ) { - global $camyks; - $n = $this->message->get_objectCount('touser="'.$camyks->adminUser->login.'" and tostatus=2'); - $camyks->trads['mod_admin_mymessages_desc'] = vsprintf($camyks->trads['mod_admin_mymessages_desc_'], $n ); - } - - /* - * init module object when in admin mode - * @return void - * @access private - */ - function init_admin () { - /* check read rights */ - if ( $this->check_right(0) === false ) { - return $this->init_admin_accessDenied(); - } - - /* get mode */ - $mode = isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'list'; - - /* execute mode */ - switch ( $mode ) { - case 'update' : - /* mode == update */ - $this->init_admin_update(); - break; - case 'send' : - /* mode == send */ - $this->init_admin_send (); - break; - case 'read': - /* mode == read */ - $this->init_admin_read(); - break; - case 'list': - default: - /* mode == list */ - $this->init_admin_list(); - break; - } - - /* generic initialisation */ - parent::init_admin(); - } - - /* specific admin mode methods */ - - /* - * init module object in admin/update mode - * @return void - * @access private - */ - function init_admin_update () { - global $camyks; - - /* get pm ids */ - $pmslist = isset ( $_REQUEST['pms'] ) ? explode(',', $_REQUEST['pms']) : array(); - $pms = array(); - foreach ( $pmslist as $p ) { - if ( isset ( $_REQUEST['pm_'.$p] ) and $_REQUEST['pm_'.$p] == 1 ) { - $pms[] = $p; - } - } - - /* get other data */ - $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; - $view = isset($_REQUEST['view']) ? $_REQUEST['view'] : ''; - - if ( $action == 0 ) { - $this->message->delete_messages ( $pms, $view ); - } else if ( $action > 0 ) { - $this->message->update_messagesStatus ( $pms, $view, $action ); - } - - /* set message display */ - $this->text = $this->get_translation( $view.'box_messages_updated' ); - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect (4, $camyks->get_adminLink($this->name) ); - } - - /* - * init module object in admin/send mode - * @return void - * @access private - */ - function init_admin_send () { - global $camyks; - - /* disable admin menus */ - $this->disable_adminEngineMenus(); - - /* get message data */ - $this->message->get_fromHeader(); - - /* save message */ - if ( $this->message->save() ) { - $this->text = $this->get_translation('pmsent'); - } else { - $this->text = $this->get_translation( $this->message->_libError ); - } - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect (4, $camyks->get_adminLink($this->name) ); - } - - /* - * init module object in admin/read mode - * @return void - * @access private - */ - function init_admin_read ( ) { - global $camyks; - - /* check private message */ - if ( !isset ( $_REQUEST['pm_id'] ) ) { - return $this->init_admin_list(); - } - - /* get message */ - $this->message->id = $_REQUEST['pm_id']; - if ( $this->message->get() === false ) - return $this->init_admin_list(); - $this->message->get_fromItems(); - - /* get buttons */ - $this->buttons=array(array('title'=>$camyks->get_translation('back'), - 'link'=>$camyks->get_adminLink($this->name))); - - /* update message status and set view value */ - if ( $camyks->adminUser->login == $this->message->vars['fromuser'] ) { - $this->message->update_messagesStatus( array( $this->message->id ), 'from' ); - $this->ouser = $this->message->vars['touser']; - $this->view = 'to'; - } else if ( $camyks->adminUser->login == $this->message->vars['touser'] ) { - $this->message->update_messagesStatus( array( $this->message->id ), 'to' ); - $this->ouser = $this->message->vars['fromuser']; - $this->view = 'from'; - - /* update button with "answer" one */ - $this->buttons[]=array('title'=>$this->get_translation('answer'), - 'link'=>$camyks->get_adminLink($this->name, - array('openTab'=>'write', - 'touser'=>$this->ouser, - 'title'=>'RE : '.$this->message->vars['title']))); - } - /* udpate layout */ - $this->selected_layout = 'admin_read.html.inc'; - } - - - /* - * initialise pm lists display action - * @return void - * @access private - */ - function init_admin_list ( ) { - global $camyks; - - /* get received pms */ - $this->receivedbox = $this->message->get_reveivedBoxMessageList(); - - /* get sent pms */ - $this->sentbox = $this->message->get_sentBoxMessageList(); - - /* add tabs */ - $this->openTab = isset ( $_REQUEST['openTab'] ) ? $_REQUEST['openTab'] : 'receivedbox'; - $this->tabObject = 'privatemessage_tabObject'; - $this->add_JSEngineFile('object/ctab.js'); - $this->add_JSScript($this->tabObject.' = new CTab();'); - $this->add_JSScript($this->tabObject.'.init("receivedbox", "' - .$this->theme->parts['boxTabCSSStandart'].'","' - .$this->theme->parts['boxTabCSSSelected'].'","' - .$this->theme->parts['boxTabCSSRollover'].'");'); - if ( $this->openTab != 'receivedbox' ) - $this->add_JSLoadScript($this->tabObject.'.mouseclick(\''.$this->openTab.'\');'); - - $this->tabs = array(array('name'=>'receivedbox', - 'title'=>$this->get_translation('tabreceivedbox')), - array('name'=>'sentbox', - 'title'=>$this->get_translation('tabsentbox')), - array('name'=>'write', - 'title'=>$this->get_translation('tabwritemessage'))); - - - /* add form for pm writing */ - $this->writeform = new HTMLForm('privatemessage_form', - $camyks->get_adminLink($this->name), - 'POST'); - $this->writeform->add_hidden('mode', 'send'); - - /* add form for received pm management */ - $this->rboxform = new HTMLForm('privatemessage_rboxform', - $camyks->get_adminLink($this->name), - 'POST'); - $this->rboxform->add_hidden('mode', 'update'); - $this->rboxform->add_hidden('view', 'to'); - $pms = array(); - foreach ( $this->receivedbox as $pm ) { - $pms[] = $pm->id; - } - $this->rboxform->add_hidden('pms', implode(',', $pms )); - - /* add form for received pm management */ - $this->sboxform = new HTMLForm('privatemessage_sboxform', - $camyks->get_adminLink($this->name), - 'POST'); - $this->sboxform->add_hidden('mode', 'update'); - $this->sboxform->add_hidden('view', 'from'); - $pms = array(); - foreach ( $this->sentbox as $pm ) { - $pms[] = $pm->id; - } - $this->sboxform->add_hidden('pms', implode(',', $pms )); - - /* get some values */ - $this->message->get(); - $this->message->get_fromHeader(); - $this->message->get_fromitems(); - - /* get buttons */ - $this->buttons=array(array('title'=>$camyks->get_translation('back'), - 'link'=>$camyks->get_adminLink())); - } -} -?> \ No newline at end of file + Manages messages sent between admin users. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_MyMessages class. + */ +final class Admin_MyMessages extends Module { + /** + * var Object $message + * @brief Message object. + */ + protected $message; + + /** + * var integer $maxmessages + * @brief Maximum amount of message stored in database. + */ + public $maxmessages = 20; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_MyMessages', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'Default'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'personal'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load plugin libraries */ + $this->load_library('Admin_InternalMessage'); + + /* Load library object */ + $this->message = new Admin_InternalMessage(0, $this); + } + + /* Override Module methods */ + + /** + * Install module. + * @return boolean success + */ + public function install() { + return $this->message->install() and parent::install(); + } + + /** + * Uninstall module. + * @return boolean success + */ + public function uninstall() { + return $this->message->uninstall(); + } + + /** + * Check module installation. + * @return boolean result + */ + public function is_installed() { + return $this->message->is_installed(); + } + + /** + * Define module permissions. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => true, + ); + $this->rights[1] = array( + 'name' => 'write', + 'title' => $camyks->get_translation('write'), + 'default' => true, + ); + } + + /** + * Update description in control panel. + * @return void + */ + public function get_adminControlPanelAction() { + global $camyks; + $n = $this->message->get_objectCount('touser="'.$camyks->adminUser->login.'" and tostatus=2'); + $camyks->trads['mod_admin_mymessages_desc'] = $camyks->get_translation('mod_admin_mymessages_desc_', $n); + } + + /** + * Initialise module object when in admin mode. + * @return void + */ + public function init_admin() { + /* Check read permission */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Load action to execute */ + $mode = isset ($_REQUEST['mode']) ? $_REQUEST['mode'] : 'list'; + + /* Execute action */ + switch ($mode) { + case 'update' : + /* mode == update */ + $this->init_admin_update(); + break; + case 'send' : + /* mode == send */ + $this->init_admin_send(); + break; + case 'read': + /* mode == read */ + $this->init_admin_read(); + break; + case 'list': + default: + /* mode == list */ + $this->init_admin_list(); + break; + } + + /* Perform generic initialisation */ + parent::init_admin(); + } + + /* Specific admin mode methods */ + + /** + * Initialise module object in admin/update mode + * @return void + */ + private function init_admin_update() { + global $camyks; + + /* Load pm ids */ + $pmslist = isset ($_REQUEST['pms']) ? explode(',', $_REQUEST['pms']) : array(); + $pms = array(); + foreach ($pmslist as $p) { + if (isset ($_REQUEST['pm_'.$p]) and $_REQUEST['pm_'.$p] == 1) { + $pms[] = $p; + } + } + + /* Load other data */ + $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; + $view = isset($_REQUEST['view']) ? $_REQUEST['view'] : ''; + + if ($action == 0) { + $this->message->delete_messages($pms, $view); + } else if ($action > 0) { + $this->message->update_messagesStatus($pms, $view, $action); + } + + /* Update layout */ + $this->text = $this->get_translation($view.'box_messages_updated'); + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/send mode. + * @return void + */ + private function init_admin_send() { + global $camyks; + + /* Disable admin menus */ + $this->disable_adminEngineMenus(); + + /* Load message data */ + $this->message->get_fromHeader(); + + /* Save message */ + if ($this->message->save()) { + $this->text = $this->get_translation('pmsent'); + } else { + $this->text = $this->get_translation($this->message->_libError); + } + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/read mode. + * @return void + */ + private function init_admin_read() { + global $camyks; + + /* check private message */ + if (!isset ($_REQUEST['pm_id'])) { + return $this->init_admin_list(); + } + + /* get message */ + $this->message->id = (int)$_REQUEST['pm_id']; + if ($this->message->get() === false) + return $this->init_admin_list(); + $this->message->get_fromItems(); + + /* Build interface buttons */ + $this->buttons = array( + array( + 'title' => $camyks->get_translation('back'), + 'link' => $this->get_adminLink(), + ), + ); + + /* Update message status and set view value */ + if ($camyks->adminUser->login == $this->message->vars['fromuser']) { + $this->message->update_messagesStatus(array($this->message->id), 'from'); + $this->ouser = $this->message->vars['touser']; + $this->view = 'to'; + } else if ($camyks->adminUser->login == $this->message->vars['touser']) { + $this->message->update_messagesStatus(array($this->message->id), 'to'); + $this->ouser = $this->message->vars['fromuser']; + $this->view = 'from'; + + /* Update button with "answer" one */ + $this->buttons[] = array( + 'title' => $this->get_translation('answer'), + 'link' => $this->get_adminLink(array('openTab'=>'write', 'touser'=>$this->ouser, 'title'=>'RE : '.$this->message->vars['title']))); + } + + /* Update layout */ + $this->set_selectedLayout('admin_read.html.inc'); + } + + /** + * Initialise pm lists display action. + * @return void + */ + private function init_admin_list() { + global $camyks; + + /* Load received pms */ + $this->receivedbox = $this->message->get_reveivedBoxMessageList(); + + /* Load sent pms */ + $this->sentbox = $this->message->get_sentBoxMessageList(); + + /* Build tabs */ + $this->openTab = isset ($_REQUEST['openTab']) ? $_REQUEST['openTab'] : 'receivedbox'; + $this->tabObject = 'privatemessage_tabObject'; + $this->add_JSEngineFile('object/ctab.js'); + $this->add_JSScript($this->tabObject.' = new CTab();'); + $this->add_JSScript($this->tabObject.'.init("receivedbox", "' + .$this->theme->parts['boxTabCSSStandart'].'","' + .$this->theme->parts['boxTabCSSSelected'].'","' + .$this->theme->parts['boxTabCSSRollover'].'");'); + if ($this->openTab != 'receivedbox') + $this->add_JSLoadScript($this->tabObject.'.mouseclick(\''.$this->openTab.'\');'); + + $this->tabs = array( + array( + 'name' => 'receivedbox', + 'title' => $this->get_translation('tabreceivedbox'), + ), + array( + 'name' => 'sentbox', + 'title' => $this->get_translation('tabsentbox'), + ), + array( + 'name' => 'write', + 'title' => $this->get_translation('tabwritemessage'), + ), + ); + + /* Add form for pm writing */ + $this->writeform = new HTMLForm('privatemessage_form', $this->get_adminLink(), 'POST'); + $this->writeform->add_hidden('mode', 'send'); + + /* Add form for received pm management */ + $this->rboxform = new HTMLForm('privatemessage_rboxform', $this->get_adminLink(), 'POST'); + $this->rboxform->add_hidden('mode', 'update'); + $this->rboxform->add_hidden('view', 'to'); + $pms = array(); + foreach ($this->receivedbox as $pm) { + $pms[] = $pm->id; + } + $this->rboxform->add_hidden('pms', implode(',', $pms)); + + /* Add form for received pm management */ + $this->sboxform = new HTMLForm('privatemessage_sboxform', $this->get_adminLink(), 'POST'); + $this->sboxform->add_hidden('mode', 'update'); + $this->sboxform->add_hidden('view', 'from'); + $pms = array(); + foreach ($this->sentbox as $pm) { + $pms[] = $pm->id; + } + $this->sboxform->add_hidden('pms', implode(',', $pms)); + + /* Load some values */ + $this->message->get(); + $this->message->get_fromHeader(); + $this->message->get_fromitems(); + + /* Build interface buttons */ + $this->buttons = array( + array( + 'title' => $camyks->get_translation('back'), + 'link' => $camyks->get_adminLink(), + ) + ); + } +} +?> diff --git a/plugin/module/Admin_MyMessages/html/admin.html.inc b/plugin/module/Admin_MyMessages/html/admin.html.inc index d3d46149..1337c60f 100755 --- a/plugin/module/Admin_MyMessages/html/admin.html.inc +++ b/plugin/module/Admin_MyMessages/html/admin.html.inc @@ -1,281 +1,266 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Jun 2007 - * Last Modif Date : Jun 2007 - * - * Admin_MyMessages module admin layout -*/ -global $camyks; -?> -theme->get_boxHeader('margin:0 auto;width:600px;');?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxTabsBar($this->tabs, - $this->tabObject.'.mouseclick', - $this->tabObject.'.mouseover', - $this->tabObject.'.mouseout', - 'receivedbox');?> -theme->get_boxContent2Header(); ?> -
- rboxform->display_header()?> - rboxform->display_hiddens()?> - - - - - - - - - - -
- - - - - -
- receivedbox ) > 1 ) : ?> - get_translation('xmessagesofy', array( count($this->receivedbox), $this->maxmessages ));?> - - get_translation('xmessageofy', array( count($this->receivedbox), $this->maxmessages ));?> - - - theme->get_barLeft ();?> - theme->get_barItem(' -
-
-   -
-
- ');?> - theme->get_barRight ();?> -
-
- - - - - - - - - receivedbox as $m ) : ?> - vars['tostatus'] == 2 ? 'style="font-weight:bold;"':''; ?> - - - - - - - - -
- get_translation('pm_title');?> - - get_translation('from')?> - - get_translation('date')?> - -   -
> - > - vars['title'] ?> - - > - vars['fromuser'] ?> - > - vars['senddate'] );?> - - -
-
- - - - - - -
- - - get_translation('selectedmessages')?> - - theme->get_button ( $this->get_translation('ok'), $this->rboxform->get_HTMLSubmitLink())?> -
-
- rboxform->display_footer()?> -
- - -theme->get_boxContent2Footer(); ?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Jun 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabs, $this->tabObject.'.mouseclick', $this->tabObject.'.mouseover', $this->tabObject.'.mouseout', 'receivedbox'); ?> +theme->get_boxContent2Header(); ?> + +
+ rboxform->display_header(); ?> + rboxform->display_hiddens(); ?> + + + + + + + + + + +
+ + + + + +
+ receivedbox) > 1) : ?> + get_translation('xmessagesofy', array(count($this->receivedbox), $this->maxmessages)); ?> + + get_translation('xmessageofy', array(count($this->receivedbox), $this->maxmessages)); ?> + + + theme->get_barLeft(); ?> + theme->get_barItem('
 
'); ?> + theme->get_barRight(); ?> +
+
+ + + + + + + + + receivedbox as $m) : ?> + vars['tostatus'] == 2 ? 'style="font-weight:bold;"':''; ?> + + + + + + + + +
+ get_translation('pm_title'); ?> + + get_translation('from'); ?> + + get_translation('date'); ?> + +   +
> + > + vars['title']; ?> + + > + vars['fromuser']; ?> + > + vars['senddate']); ?> + + +
+
+ + + + + + +
+ + + get_translation('selectedmessages'); ?> + + theme->get_button ($this->get_translation('ok'), $this->rboxform->get_HTMLSubmitLink()); ?> +
+
+ rboxform->display_footer(); ?> +
+ + + + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_MyMessages/html/admin_read.html.inc b/plugin/module/Admin_MyMessages/html/admin_read.html.inc index 11dbf08e..ddf9df12 100755 --- a/plugin/module/Admin_MyMessages/html/admin_read.html.inc +++ b/plugin/module/Admin_MyMessages/html/admin_read.html.inc @@ -1,41 +1,39 @@ - * CamykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Jun 2007 - * Last Modif Date : Jun 2007 - * - * Admin_MyMessages Module admin layout : read message -*/ +/** + * @brief Admin_MyMessages Module admin read message layout. + * @details Plugin / Module layout + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ global $camyks; ?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxContent1Header();?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxContent1Header(); ?>
- - - - - - - - - - -
- get_translation('read'.$this->view, array($this->ouser, - date_displayLongFormat($this->message->vars['senddate'])))?> -
- message->vars['title'] ?> -
- message->vars['content']) ?> -
+ + + + + + + + + + +
+ get_translation('read'.$this->view, array($this->ouser, date_displayLongFormat($this->message->vars['senddate']))); ?> +
+ message->vars['title']; ?> +
+ message->vars['content']); ?> +
-theme->get_boxContent1Footer();?> -theme->get_boxButtonsBar( $this->buttons );?> -theme->get_boxFooter( );?> \ No newline at end of file +theme->get_boxContent1Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter( ); ?> diff --git a/plugin/module/Admin_MyMessages/lib/Admin_InternalMessage.php.inc b/plugin/module/Admin_MyMessages/lib/Admin_InternalMessage.php.inc index a8d52f49..79fe8eb0 100755 --- a/plugin/module/Admin_MyMessages/lib/Admin_InternalMessage.php.inc +++ b/plugin/module/Admin_MyMessages/lib/Admin_InternalMessage.php.inc @@ -1,156 +1,150 @@ - * CamykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Create Date : Jun 2007 - * Last Modif Date : Jun 2007 - * - * Admin_InternalMessage object for Admin_MyMessages Module +/** + * @brief Admin_MyMessages Module message library + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -class Admin_InternalMessage extends ModuleLibrary { - - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_InternalMessage ( $id, &$module ) { - parent::ModuleLibrary( $id, $module ); - /* content items */ - $this->add_newItem('senddate', 'db', 'date', 'bigint', '', time() ); - $this->add_newItem('fromuser', 'db', 'text', 'varchar', 16, '' ); - $this->add_newItem('fromstatus', 'db', 'int', 'tinyint', '', 0 ); - $this->add_newItem('touser', 'db', 'text', 'varchar', 16, '' ); - $this->add_newItem('tostatus', 'db', 'int', 'tinyint', '', 2 ); - $this->add_newItem('title', 'db', 'text', 'varchar', 64, '' ); - $this->add_newItem('content', 'db', 'text', 'text', '', '' ); - $this->add_newItem('maxmessages', 'temp', 'int', 'int', '', $this->_libParent->maxmessages ); - } - - /* overwrite ModuleLibrary methods */ - - /* - * check object data - * @return boolean result - * @access private - */ - function check_data( ) { - global $camyks; - - /* basic info */ - $this->_libItems['fromuser']->value = $camyks->adminUser->login; - - /* check receipt user login / id */ - if ( AdminUser::exists_login ( $this->_libItems['touser']->value ) === false ) { - $this->_libError = 'touser_doesnt_exists'; - return false; +/** + * Admin_InternalMessage class. + */ +final class Admin_InternalMessage extends ModuleLibrary { + + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + /* Content attributes */ + $this->add_newItem('senddate', 'db', 'date', 'bigint', '', time()); + $this->add_newItem('fromuser', 'db', 'text', 'varchar', 16, ''); + $this->add_newItem('fromstatus', 'db', 'int', 'tinyint', '', 0); + $this->add_newItem('touser', 'db', 'text', 'varchar', 16, ''); + $this->add_newItem('tostatus', 'db', 'int', 'tinyint', '', 2); + $this->add_newItem('title', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('content', 'db', 'text', 'text', '', ''); + + /* Temporary attributes */ + $this->add_newItem('maxmessages', 'temp', 'int', 'int', '', $this->_libParent->maxmessages); + + /* Perform generic initialisation */ + $this->init_library(); } - - /* check if receipt user has some free slot on reveived box */ - $messagecount = $this->get_objectCount('touser="'.$this->_libItems['touser']->value.'" and tostatus>0'); - - if ( $messagecount >= $this->_libItems['maxmessages']->value ) { - $this->_libError = 'touser_receivedboxfull'; - return false; + + /* Override ModuleLibrary methods */ + + /** + * Check object data. + * @return boolean result + */ + public function check_data() { + global $camyks; + + /* basic info */ + $this->_libItems['fromuser']->value = $camyks->adminUser->login; + + /* check receipt user login / id */ + if (AdminUser::exists_login($this->_libItems['touser']->value) === false) { + $this->_libError = 'touser_doesnt_exists'; + return false; + } + + /* check if receipt user has some free slot on reveived box */ + $messagecount = $this->get_objectCount('touser="'.$this->_libItems['touser']->value.'" and tostatus>0'); + + if ($messagecount >= $this->_libItems['maxmessages']->value) { + $this->_libError = 'touser_receivedboxfull'; + return false; + } + return true; } - return true; - } - - - /* specific tool methods */ - - /* - * return messages in receive box - * @return array - * @access private - */ - function get_reveivedBoxMessageList() { - global $camyks; - return $this->get_objectList(false, - 'touser="'.$camyks->adminUser->login.'" and tostatus>0', - -1, - -1, - 'senddate', - 'desc'); - } - - /* - * return messages in send box - * @return array - * @access private - */ - function get_sentBoxMessageList() { - global $camyks; - return $this->get_objectList(false, - 'fromuser="'.$camyks->adminUser->login.'" and fromstatus>0', - -1, - -1, - 'senddate', - 'desc'); - } - - /* - * delete message list - * @param array $pms - * @param string $view - * @return boolean success - * @access private - */ - function delete_messages ( $pms, $view ) { - global $camyks; - /* escape if no item exist */ - if ( count( $pms ) == 0 ) { - return true; + + /* Specific tool methods */ + + /** + * Return messages in receive box. + * @return array + */ + public function get_reveivedBoxMessageList() { + global $camyks; + return $this->get_objectList(false, 'touser="'.$camyks->adminUser->login.'" and tostatus>0', -1, -1, 'senddate', 'desc'); } - /* try to delete from database messages marked as deleted as on both side */ - /* build sql query */ - $sql = 'delete from '.$this->_libSQLTable; - if ( count ( $pms ) == 1 ) - $sql .= ' where id='.$pms[0].''; - else - $sql .= ' where id in ('.implode(',', $pms).')'; - - if ( $view == 'from' ) - $sql .= ' and tostatus=0;'; - else - $sql .= ' and fromstatus=0;'; - - /* execute sql query */ - if ( $req = mysql_query($sql) or $camyks->log_sqlerror( $this, $sql, __FILE__, __LINE__ ) ) - /* update all other message */ - return $this->update_messagesStatus ( $pms, $view, 0 ); - return false; - } - - /* - * update message list status - * @param array $pms - * @param string $view - * @param integer $status - * @return boolean success - * @access private - */ - function update_messagesStatus ( $pms, $view, $status=1 ) { - global $camyks; - /* escape if no item exist */ - if ( count( $pms ) == 0 ) { - return true; + + /** + * Return messages in send box. + * @return array + */ + public function get_sentBoxMessageList() { + global $camyks; + return $this->get_objectList(false, 'fromuser="'.$camyks->adminUser->login.'" and fromstatus>0', -1, -1, 'senddate', 'desc'); + } + + /** + * Delete message list + * @param array $pms + * @param string $view + * @return boolean success + */ + public function delete_messages($pms, $view) { + global $camyks; + + /* Escape if no item exist */ + if (count($pms) == 0) { + return true; + } + /* Try to delete from database messages marked as deleted as on both side */ + $sql = 'delete from '.$this->_libSQLTable; + if (count ($pms) == 1) + $sql .= ' where id='.$pms[0].''; + else + $sql .= ' where id in ('.implode(',', $pms).')'; + + if ($view == 'from') + $sql .= ' and tostatus=0;'; + else + $sql .= ' and fromstatus=0;'; + + /* Execute sql query */ + if ($this->execute_DBQuery($sql, __LINE__)) + /* Update all other message */ + return $this->update_messagesStatus($pms, $view, 0); + return false; + } + + /** + * Update message list status. + * @param array $pms + * @param string $view + * @param integer $status + * @return boolean success + */ + public function update_messagesStatus($pms, $view, $status=1) { + global $camyks; + + /* Escape if no item exist */ + if (count($pms) == 0) { + return true; + } + + /* Build sql query */ + $sql = 'update '.$this->_libSQLTable; + $sql .= ' set '.$view.'status='.$status; + if (count($pms) == 1) + $sql .= ' where id='.$pms[0].';'; + else + $sql .= ' where id in ('.implode(',', $pms).');'; + + /* Return result of sql query execution */ + return ($this->execute_DBQuery($sql, __LINE__)); } - /* build sql query */ - $sql = 'update '.$this->_libSQLTable; - $sql .= ' set '.$view.'status='.$status; - if ( count ( $pms ) == 1 ) - $sql .= ' where id='.$pms[0].';'; - else - $sql .= ' where id in ('.implode(',', $pms).');'; - - /* return result of sql query execution */ - return ( $req = mysql_query($sql) or $camyks->log_sqlerror( $this, $sql, __FILE__, __LINE__ ) ); - } } -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_MyMessages/locale/translation_en.php.inc b/plugin/module/Admin_MyMessages/locale/translation_en.php.inc index 983cf88c..829bfab9 100755 --- a/plugin/module/Admin_MyMessages/locale/translation_en.php.inc +++ b/plugin/module/Admin_MyMessages/locale/translation_en.php.inc @@ -1,15 +1,14 @@ - * CamykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Create Date : Jun 2007 - * Last Modif Date : Jun 2007 - * - * Admin_MyMessages english dictionnary +/** + * @brief Admin_MyMessages Module english dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ $this->trads['mod_admin_mymessages_title'] = 'Private messages'; $this->trads['mod_admin_mymessages_desc'] = ''; @@ -55,4 +54,4 @@ $this->trads['mod_admin_mymessages_ok'] = 'OK'; $this->trads['mod_admin_mymessages_readto'] = 'Message for %s, written on %s.'; $this->trads['mod_admin_mymessages_readfrom'] = 'Message de %s, written on %s.'; $this->trads['mod_admin_mymessages_answer'] = 'Answer'; -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_MyMessages/locale/translation_fr.php.inc b/plugin/module/Admin_MyMessages/locale/translation_fr.php.inc index 388f143f..c59def24 100755 --- a/plugin/module/Admin_MyMessages/locale/translation_fr.php.inc +++ b/plugin/module/Admin_MyMessages/locale/translation_fr.php.inc @@ -1,15 +1,14 @@ - * CamykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Create Date : Jun 2007 - * Last Modif Date : Jun 2007 - * - * Admin_MyMessages french dictionnary +/** + * @brief Admin_MyMessages Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jun 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ $this->trads['mod_admin_mymessages_title'] = 'Mes messages'; $this->trads['mod_admin_mymessages_desc'] = ''; @@ -18,7 +17,7 @@ $this->trads['mod_admin_mymessages_desc_'] = 'Vous avez %s nouveau(x) message(s) /* admin messages */ $this->trads['mod_admin_mymessages_back'] = 'Retour'; $this->trads['mod_admin_mymessages_pmsent'] = 'Message privé envoyé.'; -$this->trads['mod_admin_mymessages_touser_doesnt_exists'] = 'Le destinataire n\'existe pas. Vérifier l\'écriture exacte de son pseudo ( attention aux majuscules ).'; +$this->trads['mod_admin_mymessages_touser_doesnt_exists'] = 'Le destinataire n\'existe pas. Vérifier l\'écriture exacte de son pseudo ( attention aux majuscules ).'; $this->trads['mod_admin_mymessages_touser_receivedboxfull'] = 'La boite de réception du destinataire est pleine. Il devra la vider un peu avant de pouvoir recevoir de nouveaux messages.'; $this->trads['mod_admin_mymessages_tobox_messages_updated'] = 'Les messages sélectionnés de votre "Boite de réception" ont été mis à jour.'; $this->trads['mod_admin_mymessages_frombox_messages_updated'] = 'Les messages sélectionnés parmi vos "Messages envoyés" ont été mis à jour.'; @@ -55,4 +54,4 @@ $this->trads['mod_admin_mymessages_ok'] = 'OK'; $this->trads['mod_admin_mymessages_readto'] = 'Message pour %s, écrit le %s.'; $this->trads['mod_admin_mymessages_readfrom'] = 'Message de %s, écrit le %s.'; $this->trads['mod_admin_mymessages_answer'] = 'Répondre'; -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_SecurityTools/lib/Admin_SecurityToolsCaMykSIntegrityDescription.php.inc b/plugin/module/Admin_SecurityTools/lib/Admin_SecurityToolsCaMykSIntegrityDescription.php.inc index 946b8b13..e259e109 100755 --- a/plugin/module/Admin_SecurityTools/lib/Admin_SecurityToolsCaMykSIntegrityDescription.php.inc +++ b/plugin/module/Admin_SecurityTools/lib/Admin_SecurityToolsCaMykSIntegrityDescription.php.inc @@ -1,20 +1,20 @@ integrityCheckResult = array ( - 'date' => 'Tue, 05 Jan 2021 11:50:06 +0100', + 'date' => 'Mon, 01 Feb 2021 18:10:05 +0100', 'gitLastCommit' => NULL, 'files' => array ( 'Camyks.php.inc' => array ( - 'checksum' => 'c49c00035d45fdfea8e8cca399a999622759344099783746a14400cd20049a5e', + 'checksum' => 'a1ea3c63aac15c6a753b34a4c8d32730264c2a5fbe5ba80470a49d672cf7df76', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.21.1', + 'version' => '1.0.21.2', ), 'docker/start-apache2.sh' => array ( @@ -296,6 +296,55 @@ $this->integrityCheckResult = array ( 'normalised' => 1, 'version' => '1.0', ), + 'plugin/input/LimonetikPayment/locale/translation_fr.php.inc' => + array ( + 'checksum' => '956234c5b295e28309b993caf87ffb795bb26459c74b1e93510769f978df79b0', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.1', + ), + 'plugin/input/LimonetikPayment/LimonetikPayment.php.inc' => + array ( + 'checksum' => '39d48830114501c6a751eb78ee8c016a26d5abab6a91a61ecc7a75f7a39575c7', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.1', + ), + 'plugin/input/LimonetikPayment/html/configuration/edit.html.inc' => + array ( + 'checksum' => '207c7748227c84b11e2fc45a0509e7bde93c60a6e6e4ec8ca47beb6c453e7286', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.0', + ), + 'plugin/input/LimonetikPayment/html/configuration/view.html.inc' => + array ( + 'checksum' => 'bc478a65e7f819a4ccd35ab34adf5f5057c5e6272637b20494b3f8f07ce680d2', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.0', + ), + 'plugin/input/LimonetikPayment/html/input.html.inc' => + array ( + 'checksum' => '00568732e5534da6b5853b311631b8d52641f23ab666f514ca8677005d2029e2', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.1', + ), + 'plugin/input/LimonetikPayment/html/Error.html.inc' => + array ( + 'checksum' => 'c77ded34880f4c4b27299ec55cb596a378f27fe461f1d49c68a7451f0f4d0ff7', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.0', + ), + 'plugin/input/LimonetikPayment/lib/LimonetikPaymentConfig.php.inc' => + array ( + 'checksum' => '483396500685658d5ae1284bce0e5675209f057b529fa4b8f2a55e7f313ba0ba', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.0', + ), 'plugin/input/PerpetualCalendar/css/perpetualcalendar.css' => array ( 'checksum' => '6e3a1a4fb2932cc87d8a3a202d16ea99c7ca0cd8f882c6e7a65b4bf16c05cc5d', @@ -4057,7 +4106,7 @@ $this->integrityCheckResult = array ( ), 'plugin/input/StripePayment/css/global.css' => array ( - 'checksum' => 'b4c24e5a03379e95a3bfc9275e97fb42e1c31edb1cddaf1bde3c79989138a37a', + 'checksum' => '756681f73ee727d23da087c817daa3f8a9066ed4dd7e6b2d2670dc54dce1ba20', 'mime' => 'text/plain', 'normalised' => 0, 'version' => '', @@ -5933,10 +5982,10 @@ $this->integrityCheckResult = array ( ), 'plugin/input/GenericMediaPopup/js/mediapopup.js' => array ( - 'checksum' => '419374e35f6fd1d6318c555d7e2c182d6ba436d7ad3775cf3f2bf24ffefa5bd8', + 'checksum' => '6808b282d16e379ade53de0d398eb2f6ba81a8e798ef2e36b29a017e0ae85436', 'mime' => 'text/plain', 'normalised' => 0, - 'version' => '1.0.2', + 'version' => '1.0.3', ), 'plugin/input/GenericMediaPopup/js/tinymce_plugin/link.htm' => array ( @@ -6192,10 +6241,10 @@ $this->integrityCheckResult = array ( ), 'plugin/input/SocialNetworksSharingPanel/locale/translation_fr.php.inc' => array ( - 'checksum' => '0499b6539fdee4b80f01914e5473994707789f6332446af3c7c6db23819f1522', + 'checksum' => '3b62f3bd73c7a024630053fb68092f68ec36c21e71f2c492488be0988fcbb42b', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0', + 'version' => '1.0.2', ), 'plugin/input/SocialNetworksSharingPanel/css/styles.css' => array ( @@ -6213,17 +6262,17 @@ $this->integrityCheckResult = array ( ), 'plugin/input/SocialNetworksSharingPanel/html/configuration/edit.html.inc' => array ( - 'checksum' => 'bb32815569663d5f2b6b2b9a6fed323beb3d9d688d3fcd0015f5b66063a2b722', + 'checksum' => '02c4cda5b9c797ceb07e90c7da6ee92818991cc8284169fa1e02032748871a1c', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.1', + 'version' => '1.0.2', ), 'plugin/input/SocialNetworksSharingPanel/html/configuration/view.html.inc' => array ( - 'checksum' => 'db47eac33e692261687225efefc6195b9aaac05bf616e886d98b646d17b87a23', + 'checksum' => '2da23f7bcf6fa8a05622db756dc89b279d460d00bc0037e3f4cb85d1c57fdb1a', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.1', + 'version' => '1.0.2', ), 'plugin/input/SocialNetworksSharingPanel/html/input.html.inc' => array ( @@ -6232,6 +6281,13 @@ $this->integrityCheckResult = array ( 'normalised' => 1, 'version' => '1.0.3', ), + 'plugin/input/SocialNetworksSharingPanel/html/Integrate/facebook.html.inc' => + array ( + 'checksum' => '17570382e11727d16a739092aaacb3dcaf9112cc1977c96457eaa36b38f7838d', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.0', + ), 'plugin/input/SocialNetworksSharingPanel/html/input_follow.html.inc' => array ( 'checksum' => 'e1998ba54ce705a6d99943cbc72fd3901cb559b5a1e5573fa0eabf0b2a99bf18', @@ -6241,10 +6297,10 @@ $this->integrityCheckResult = array ( ), 'plugin/input/SocialNetworksSharingPanel/SocialNetworksSharingPanel.php.inc' => array ( - 'checksum' => 'e1468a714c9b9c6b63d9f7f1ae6da7b221687762391da6e2c65f75d84aed0ca3', + 'checksum' => '72afc3ea22682b4cbf57deaec0842e706e98eb743365998851423f4cd9a7fc52', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.2', + 'version' => '1.0.3', ), 'plugin/input/SocialNetworksSharingPanel/img/followIcons/digg.png' => array ( @@ -6535,10 +6591,10 @@ $this->integrityCheckResult = array ( ), 'plugin/input/SocialNetworksSharingPanel/lib/SocialNetworksSharingPanelConfig.php.inc' => array ( - 'checksum' => 'f3f4d873d46a9a103a3645fffb2067cecf6b7ff359234ef9d48f1824ca93a02c', + 'checksum' => '27c74739f2953d408de3877b222ffe7c53e5f889b8ed3699fe31fb4de36eb0e4', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.1', + 'version' => '1.0.2', ), 'plugin/input/SecurimageCaptcha/SecurimageCaptcha.php.inc' => array ( @@ -9510,10 +9566,10 @@ $this->integrityCheckResult = array ( ), 'plugin/input/BreadCrumbs/BreadCrumbs.php.inc' => array ( - 'checksum' => '17e5cae9f92dec8aed22031e5c12ff2c4e1899b5427959f088108890b5a8fb46', + 'checksum' => 'a92556d93dea0a5976f74231c1544e73144e5394ea116062c4caddf71e878fd2', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0', + 'version' => '1.0.1', ), 'plugin/input/MultiSelectionList/MultiSelectionList.php.inc' => array ( @@ -10224,45 +10280,45 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GlobalHelp/locale/translation_en.php.inc' => array ( - 'checksum' => '9a8ecc9bb7e1adb2f9a1ac1c774422b903a817d414821e6c8220ce7529336810', + 'checksum' => 'c30c896b21f17b86768b2d8128b92fdfa8e7f0f1555a48943a9d89472b2219b9', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GlobalHelp/locale/translation_fr.php.inc' => array ( - 'checksum' => '25aacbd3577dc59ab2ece7fc7460e1ccb86dd3331edd442c3a9628c6ff396874', + 'checksum' => '9003c6b199f6b6341fc4d08ee1306afe2fc91bcd53d6a3fd69339c893720dfe2', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GlobalHelp/Admin_GlobalHelp.php.inc' => array ( - 'checksum' => 'ba880856995834ed9479e9576fb1f0ed2c85e646e573cd461b489d62e4774154', + 'checksum' => '7162ee9f609f176ab814a5e965b42a2ee5a4f84ebe6963db39eed2278c07aa50', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GlobalHelp/html/display_modules.html.inc' => array ( - 'checksum' => '7fe0e9504adf83497d5c02f9663adc701a0a3ca75158ba3edefefa52d8c66682', + 'checksum' => 'd17beeab596adc1fd07135bbd6fa54d8df5d6bf5fd47a3fa78212dfbf4af2140', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GlobalHelp/html/display_engine.html.inc' => array ( - 'checksum' => 'eace9eb359315d99276e686a4d3f469d4eb448462087ef84594004449cf30627', + 'checksum' => '3f689addd8b32dde933a9c4571f7ad774f87f3b693d0e704c16037eb07b460d8', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GlobalHelp/html/list.html.inc' => array ( - 'checksum' => '7cf0e74e1da016ad0650c9aa9ef7ed0491704e37d45a1de6e3aadfa2a0b516d9', + 'checksum' => 'c33dcf6c1ce2105dc4c7199c98e75a57af4945da348466f74946c586aaaaa660', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GlobalHelp/img/icon32.gif' => array ( @@ -10518,10 +10574,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericGuestBookManager/Admin_GenericGuestBookManager.php.inc' => array ( - 'checksum' => '32f951e353493b8ebb6aff501270bbae44155ea93ee9cc9ae487fe1a894c2d80', + 'checksum' => '3195c00e63183e292619d4b31c53da2f4801d905560ec53f59bee6015a80cbea', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.1', + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericGuestBookManager/locale/translation_fr.php.inc' => array ( @@ -10735,10 +10791,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_User/lib/AdminUser.php.inc' => array ( - 'checksum' => 'cb307d7b711f1c7ec5e429f7094441f9c0cf249f00f2a32039e8640a6fb04d30', + 'checksum' => '836c6636cb1de805b381710c8b63abf78052ddc10633c4a9e6a017c1fcc36417', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.2', + 'version' => '1.0.2.2', ), 'plugin/module/Admin_User/lib/Admin_UserListParams.php.inc' => array ( @@ -10903,108 +10959,94 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericContactFormManager/locale/translation_fr.php.inc' => array ( - 'checksum' => '056007b8097eb3043a9d260b2d09ff6f00a14e9e62ebb97caa783c3582dbae13', + 'checksum' => '840f9f1b85a817ffe53d451213da78b3a5f7716e15e6ebdd8f47e3b459696940', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', - ), - 'plugin/module/Admin_GenericContactFormManager/locale/data/translation_fr.php.inc' => - array ( - 'checksum' => '17f000f506bbb9fc0230b6b41a5b39526831e11633b360dcc8dadb671c63b9e5', - 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', - ), - 'plugin/module/Admin_GenericContactFormManager/js/usersmanager_accounteditor.js' => - array ( - 'checksum' => '1609ffce30fd193c174eda14bbb556ff817ef6410600fe91ca8cfbb9a8b041e3', - 'mime' => 'text/plain', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/Admin_GenericContactFormManager.php.inc' => array ( - 'checksum' => '7d74ae2c2a670fe9cdc0b7b27704daae95ed320fd876d79bd0d28400974a8e1b', + 'checksum' => 'e231d515f8e4631eb86831f8f530c462d98f00b840c792991175945f099b1c0b', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericContactFormManager/html/admin_view_msg.html.inc' => array ( - 'checksum' => '1298f2c3959c45b6da06c987d2125e5c3bf6e9b063f27311b835d190c516e7bc', + 'checksum' => '09ec61ff9a8a976712441400bb4097e94d59773f1268c536845860a2983cc0c8', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/html/admin_edit_msg.html.inc' => array ( - 'checksum' => '0b79d286df07cd87a2df29dceea6ec630884e678939459698803b56f7cc9102b', + 'checksum' => '5c7250b2382ff282841247ed38e0b75392deac301f7703ade9157366cd25d884', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/html/admin.html.inc' => array ( - 'checksum' => 'ef0240db7ec539953b91528b87d92fd2f5d706d6d82181b757a50fa8295d0e9d', + 'checksum' => '0f7aa6ac3ceafc1d65ebba578c99fa17881a0f8ed69525ad311b3c4ed16e731d', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/html/email_notification.html.inc' => array ( - 'checksum' => '7c30883bdd642d999b9ea84246e320cf7aea1820cf46b91c0e47a18cc6277a58', + 'checksum' => '3d493ff348a364221eca3477fba16acb412fc1181215d835788f8f10e4733878', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/html/admin_view_config.html.inc' => array ( - 'checksum' => '31a2204ea21a48629613cdf4254954b13d18534752a8528fc4a70adb01ba751b', + 'checksum' => '58b008832dea80a10ba496bfa9455c52cace370b66446ba089c931b547310f2a', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/html/admin_edit_config.html.inc' => array ( - 'checksum' => 'e002ae73eca6dbaba3c2b80dad7e23e0ccf59c1ed9d7e8e471b68a15ab7cafe0', + 'checksum' => 'ce3a524872742a6131800d3ae7429e7d9b4986a5d78f43525210251d020b3632', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerFormListParams.php.inc' => array ( - 'checksum' => 'f45437175ba90f776d1acc77048cfb2a0e17daa3d1af48aeefd1c2cf400de761', + 'checksum' => '2d690bf03f598d2eaedfa2e6f900b1c9d8a7c315e397353015b55f6d05aab9eb', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerForm.php.inc' => array ( - 'checksum' => '51833687707f48b57bf68e3dfbae0e0d669a1d99ec6ffec20d9a7f2f99374e4c', + 'checksum' => '41a94158819c4a2b1ab450b75bebadab5d3ff8a3db879654ffd19a204e05f5e7', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubjectListParams.php.inc' => array ( - 'checksum' => '9b85c3815f4f0f58c81a0acaac3268f81007693efc90917970fdf2d6c93538b2', + 'checksum' => 'da7b0cc83e49db978d9d32b87667e762faa7affba23e873fc97021330d0cc28f', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerConfig.php.inc' => array ( - 'checksum' => 'ddbe7311d06346f0c318f1296fe00eb13fb70dd6fd5c3f67b00e25373c3d400a', + 'checksum' => '312ab01057fb525bf24390d0a2e71aa68bb238e1eba8c031295e8ac14697ac07', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericContactFormManager/lib/Admin_GenericContactFormManagerSubject.php.inc' => array ( - 'checksum' => 'bb981154bbb140ac0d300f118d082fe540c14f68cf3ff108ea0158f639ae9eca', + 'checksum' => 'c05a3fc36cc4ba2c707fa57e2002e501594dd3d55d657a3748fb696cba90d4bb', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Content_GenericQuickMessage/locale/translation_fr.php.inc' => array ( @@ -11127,31 +11169,31 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_MyMessages/locale/translation_en.php.inc' => array ( - 'checksum' => 'd8fdcd70e1c07a0c5af46c1c955d6ff2c3dc9674b64afd8478d3707dbf313fec', + 'checksum' => 'e1df375d17929db1107b02de46ceeb20aa93295d13e06f3ad3e624186bc11c17', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_MyMessages/locale/translation_fr.php.inc' => array ( - 'checksum' => '81756d0f97e5c66b0e30bc2f4479aa8e9740a57f04867023a7b2a096826f66d8', + 'checksum' => 'ba6c7478c29ae858dd99d7421dd94a76b58394725db2626d37d4f2a81b005379', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_MyMessages/html/admin_read.html.inc' => array ( - 'checksum' => 'e8c11cb3235f483bdddccb9317fbb95a7da468fd51f9b3fb667799ada4540eb0', + 'checksum' => '6fc7fbb7499f7b1afec16820f6eb19f33a5e9c6d2ea4574b7e82ef63db7c4ba1', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_MyMessages/html/admin.html.inc' => array ( - 'checksum' => 'd8ad7525292acaea90b9f0f5abd0df7a6b59ebc097bbd1a7f5b243793f502e68', + 'checksum' => 'fd3448c13b083370c4f0d4f8c50b847dfe2df1d9985af58fee33052d37f545bd', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_MyMessages/img/usage.gif' => array ( @@ -11176,17 +11218,17 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_MyMessages/lib/Admin_InternalMessage.php.inc' => array ( - 'checksum' => '12b135c77b7e3e096f918083a4a7df8167d978a2b98b38b642b308294d232ce9', + 'checksum' => '42842804542a70e1c04c8318a87253afe828f957a1b0c9f7c8bd803c1683a9c7', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_MyMessages/Admin_MyMessages.php.inc' => array ( - 'checksum' => 'dbb6cb38887debeffeced8303a486f94e725adb3710043f4e7ac75c33b24d6ca', + 'checksum' => '2b3041223ec4273c1686011b09d1ea2bc0b8e9c07264aaa5c62c6f6a007f016d', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Tool_Installer/locale/translation_en.php.inc' => array ( @@ -11246,66 +11288,66 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericMediaLibraryManager/locale/translation_fr.php.inc' => array ( - 'checksum' => '6bd54cd4d9e8a0ecad7a2477e0490a6f89d59d4714aa141e3d0941a2b167e0ad', + 'checksum' => 'e892b64bb66641e12fe4db9366ffff27fb1b958cd379a870a8923d521337cd33', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/js/PictureList.js' => array ( - 'checksum' => '40a4db48edcb556a05991f51d532ab2e9bd516826dc189523a604b38635f7d62', + 'checksum' => '71bc052f2b5987350ecde68d971d0a0d7d8769c8c6c13fab9e165547ab7bd734', 'mime' => 'text/plain', 'normalised' => 0, - 'version' => '', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/js/PictureSaving.js' => array ( - 'checksum' => '25382f1088dcdd3371bba6782ad43e2e780d723edb479a3f52222483b9a248ad', + 'checksum' => '3e093af1a99c5074cda7a8a48a2c61e001ea3fdd24b992d2a8434e3849bf1dd5', 'mime' => 'text/plain', 'normalised' => 0, - 'version' => '', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_edit.html.inc' => array ( - 'checksum' => '96212057c04cb7d2070ec1f7d39bad15f4a2c1d09db06f225b0c0b46679f1264', + 'checksum' => 'cca500ca7faa1a7c6ac68f6c1892514c7cff26231ce27872a76d36e6a94ab9f3', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.2', ), 'plugin/module/Admin_GenericMediaLibraryManager/html/configuration/admin_view.html.inc' => array ( - 'checksum' => '6b985f96e0cf142339bc3caee0c51926ce6296cebef849b261922879e776cba4', + 'checksum' => 'c0cf0a39db6e44230dfe83cbb585f57db52f038e4c522e7b825de939d7766238', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.2', ), 'plugin/module/Admin_GenericMediaLibraryManager/html/admin_view_pictureGallery.html.inc' => array ( - 'checksum' => '37430e78241c17b41373ade0db099fd71e1566726c73412038f51791d8d0f2bc', + 'checksum' => '3c0011d6cf82ed91cb86c65f41b84db2fad23f2f5f82abce730f69b909b2d455', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.2.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/html/admin.html.inc' => array ( - 'checksum' => 'c4eed169caf6c5b0e11d2108d741bbc2807b5d9796f82b0075b53f1ecfe09f4e', + 'checksum' => '7be13a08bb6477bc1ac1e2cbfb16398ab9787fd46ae7d06b0dc8ab7de630fc55', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.2.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_picture.html.inc' => array ( - 'checksum' => '235626c4384d24525893ee3a1cd36c484f81fa441e8769c59b00f4ed632dec29', + 'checksum' => '49ab2499f0382b9f4af6bf7e8ba8ecd40af4036909631b8723cab0fa32b6db83', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.2.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/html/admin_edit_pictureGallery.html.inc' => array ( - 'checksum' => '87111110ce09f43ef82bb6276bcf47e292df8ddfcf67f41b20e6c87b9f538178', + 'checksum' => '7868c214299ebaa9d7e858d75be0eb385c0c4e7166192eb7ad90d7938774f5ac', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.2.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/img/preview.jpg' => array ( @@ -11330,52 +11372,52 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericMediaLibraryManager/Admin_GenericMediaLibraryManager.php.inc' => array ( - 'checksum' => '84a7f4beaaa2afdb65affd6259ec6611ae69b618cbde830f8c02e1db4c0b606a', + 'checksum' => '27c6d49f4b2f16a6135e41d05ffd0046d9b4f273475c7d3f2453335d26aeb6ee', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureListParams.php.inc' => array ( - 'checksum' => 'd54b109acdce4ae14a84e316b5e2c0a4bd5721b5fc3b80c6905c6dc395341575', + 'checksum' => 'ca4ceb173befef51ccadca26612640d9579198fd89d3a0ddea0a94503461edae', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGallery.php.inc' => array ( - 'checksum' => 'ee8009b59075749b125fcb3d418e5b7693b7983088e7fbfccfe1c149ca31a6b5', + 'checksum' => 'dfa422d3b18e99ad2a2754e03f25aa00df6ea44b6aa20a30d3b8aeb016e7e18c', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureSelectionListParams.php.inc' => array ( - 'checksum' => '74981703799de5c82830327ee2208c69bfba3750d0dcaa446f9bd19214611b32', + 'checksum' => '453fcf0bc5ea9489e911dfda35295347590aa5988f47d5109147c624321b7b45', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPictureGalleryListParams.php.inc' => array ( - 'checksum' => '97ba27059778ebc325315779100ddc8eba662cb7f1f82517ae5ff0327707ae6e', + 'checksum' => '0bbeebbe0804c5a6f3ddaeeebae488aee21156733bb54054433bf8aeb196bb61', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerPicture.php.inc' => array ( - 'checksum' => '7288dbafed86384cbd4069b1711af7d60db77aedcf3eccaedaa4045432b90a08', + 'checksum' => 'b13d39950a0cf5f5fc92d53a4cc608dc78326a838ecef44347143463a93d0b45', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_GenericMediaLibraryManager/lib/Admin_GenericMediaLibraryManagerConfig.php.inc' => array ( - 'checksum' => '1e1ad431874723a0bfc9cd34797d4eabbfc22f1fb812bcffa936d152119f5620', + 'checksum' => '3cddcaeceb479480cc187a2f7e728a2f500637111bbdb1220781572e98e06657', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Content_GenericPageList/locale/translation_en.php.inc' => array ( @@ -11820,24 +11862,24 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GoogleTools/locale/translation_fr.php.inc' => array ( - 'checksum' => '6c3d6a8460ddb31af2590b5b9ebf58d23b992ba6913aed183bf8b35b43958fd8', + 'checksum' => '50f7b2320e8658cf3c285644309aa0abcde40e01a4e4497e9af05584feb7614c', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GoogleTools/html/admin.html.inc' => array ( - 'checksum' => '5400e0a1081c79c6493cbdf514f4925eefdd3b61c9d4e27378b866c28ce8c60d', + 'checksum' => 'b8c7602580462c7d7e94ce9c8e399f8236ff2dbaea997b553ff3c5b4b7353828', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GoogleTools/Admin_GoogleTools.php.inc' => array ( - 'checksum' => 'b7773a98d6f9a2ccbd65be867d75a6de4cec5b0538d6020b6528cb1c8ad070e1', + 'checksum' => '75213eb7b71cee73fe6b89f3da66fa81fdea331c0cb185399069288c998d9621', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDownloadManager/locale/translation_en.php.inc' => array ( @@ -12058,17 +12100,17 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericDirectoryManager/locale/translation_fr.php.inc' => array ( - 'checksum' => '5103b21d429245b0737285afad2b22005b2954708c3c7d867d9821a3bb237033', + 'checksum' => '8900fe5d2879afa6449908b1cfdd3e057ea5857340ee3bb57b4fb28fbef117ac', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/Admin_GenericDirectoryManager.php.inc' => array ( - 'checksum' => '4cced3a5c376578ed94fc0729ef505db74e16f13c630f5b1a2672d8e6ca07a6e', + 'checksum' => 'bf7a93ac08f9b765ce896296ce6edeb28d8968631d318f7eb42b53a1f9ff1264', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/js/glossarymanager.js' => array ( @@ -12079,52 +12121,52 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericDirectoryManager/html/admin_edit_category.html.inc' => array ( - 'checksum' => 'd7d1b3bb4eaf1b02f6d4aa7f9a2014918d28e8b37c84deebc314e55de8ca66a5', + 'checksum' => '0a0c76a42aa80736e6de0f0986def5272f0ec3f1d960083958a818c59ed0ad56', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/html/admin.html.inc' => array ( - 'checksum' => '3c3efd8dc1fba5bffe83bfad7fc534fe2d664129e26c20e00c6d80cbb7126310', + 'checksum' => '7f0bdc9dc223a10f6f4ec6de01919d9e5e71feed719a92dec768905062c1226b', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/html/admin_edit_contact.html.inc' => array ( - 'checksum' => '0706e0944ba8a09163c690aed811fc4e9cbfa7416511a937236e231b3a1a2ece', + 'checksum' => '0e359926abde018df9ac548e163818dc48755068f8f1161d691ea53a150d6b1a', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContact.php.inc' => array ( - 'checksum' => 'c70f174f0aa9041d0db8e9f176cc380eeb7ee21e3b188df5a42088a738d6af1f', + 'checksum' => 'd33e99aa3a91336450b5c7e547d646e85702e652210e860cc32a1764318dd230', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategory.php.inc' => array ( - 'checksum' => 'ca9b7f525c06ae8e8a6792176b4f1e06635bdbccd3abdd702a4ffc4c6f645e36', + 'checksum' => '9deb10117eaa5df059e8ae8896e3320c9fc2d5934f91bff7be027631b95252e3', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerContactListParams.php.inc' => array ( - 'checksum' => '76c6469456d4a0dd75d6bfff07bd0b7b7a02ce00961bfb6389e5f02947b001ee', + 'checksum' => 'e780ec430bfd6eca095d3165a3a1a6d54816e3194ba851a286fe4aacace99ef7', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericDirectoryManager/lib/Admin_GenericDirectoryManagerCategoryListParams.php.inc' => array ( - 'checksum' => '59bcbe228409ae692097595a91a0cbfb9ab659d8fbb7d7e1a3298f431612c0c9', + 'checksum' => 'd4492ec038110ca7ee762241e48607722fa7550b594c983158e9a80538508307', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Content_GenericMenu/locale/translation_en.php.inc' => array ( @@ -12625,38 +12667,38 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericPetitionManager/locale/translation_fr.php.inc' => array ( - 'checksum' => 'c6672165febf6d0858f6f240d974ddfdad298473ac141ce4bcfbb82fc7e5fe5f', + 'checksum' => 'a956e0e28441f2f6ebdee851bf3e699d951b80d4399cbf07061643b59c70c257', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/html/admin.html.inc' => array ( - 'checksum' => 'badce0a7d418e39dc7053fa3666ffdb230b14822b82dc2f2af7165c81f800daf', + 'checksum' => '28a31b31bad852a43c93fc41bcbc3c29215e73c383429d8243b32d89c5973b0d', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/html/admin_edit_signature.html.inc' => array ( - 'checksum' => '2683277f7b06d1663a551f11b2236c093b18f4ad56f723d9a1eeca4c72d61870', + 'checksum' => '64a665b4b1d33451784a822dc2dd65d9a8c1518188f787f9c90e654746a813ae', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/html/admin_list_sign.html.inc' => array ( - 'checksum' => '7e1dfd63bf1662484e4cd9e8623d7560274e76730a4d209d0773f7175bb8e445', + 'checksum' => '52c3f7eb3bd064145d713c5665cf4781923398f569546ffa9763e1f6c416c190', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/html/admin_edit_petition.html.inc' => array ( - 'checksum' => 'edf1585b445c4d75d80d8df62de4910dbb561e441e168a27cba298430087a425', + 'checksum' => '4eb05bd0da0b96c597a8acaf7963fec68e6f930e347f55c953b594149c7e3317', 'mime' => 'text/x-php', 'normalised' => 0, - 'version' => '', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/img/xls.gif' => array ( @@ -12667,38 +12709,38 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetition.php.inc' => array ( - 'checksum' => '14eed834c6dfe4f7c23f7c044e6c3ffb6728e155a212d9294996675dded0117e', + 'checksum' => '46ad268a53181de61735ff45aa5ed6f25b155e3064706a220a6b3a1cb2a9c63b', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignature.php.inc' => array ( - 'checksum' => '3f86ddedf39f0eebbc8f09d9c598801ec3090a497d04f0d7479e5d3dc35836ab', + 'checksum' => 'daa5ee78ddcfaaf330e88c59c3f129306fe7f07c7a24d551789f566b39ec33b0', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerPetitionListParams.php.inc' => array ( - 'checksum' => '8da4810e433b9184bd7cbb3ba7e96fa4cc4f0b220bf0c56bf93150b01e49b943', + 'checksum' => 'f9cdd50c7119f553d881fc3905ba0bf1afca833d86e7a0c4034d4d0506a95003', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/lib/Admin_GenericPetitionManagerSignatureListParams.php.inc' => array ( - 'checksum' => '5c5034ca4ce7f434bfd42da07090e95e7a76c1f51d750173e23bf35b5ab76756', + 'checksum' => '930430eafa129a5f17ffdd3478aa62dbac701c1c97492775c1f6e391d094975b', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericPetitionManager/Admin_GenericPetitionManager.php.inc' => array ( - 'checksum' => '08f3987f10504250bc9cf8ab97e0d5bc8ff729038f7da2119956d2bfaa0894ec', + 'checksum' => 'fcd195bdc7b94c7a30fe12b7bec2693b980dd90d97671999e727e3a4f2c69feb', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_SystemReport/locale/translation_en.php.inc' => array ( @@ -12765,10 +12807,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_SystemReport/Admin_SystemReport.php.inc' => array ( - 'checksum' => '76276adf1c2fb7470b79bbf079629eb51678b4503de5ffc9e423892daf690fda', + 'checksum' => '9cc63b28e273a29384448f12a48adbae8d0e63ad458cce95d7c40501de16c925', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.3', + 'version' => '1.0.3.1', ), 'plugin/module/Admin_SystemReport/lib/Admin_SystemReportItem.php.inc' => array ( @@ -12898,31 +12940,31 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_SystemUniqueIDManager/locale/translation_fr.php.inc' => array ( - 'checksum' => '35bc989c0edd04587dca1be3e8d157517679e7c1058944cded2d3f22b5bee782', + 'checksum' => '89e236a1f62769e7a34b14c10cbc4f4cc3b3a11694d81064594f7c1b80f7c465', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_SystemUniqueIDManager/Admin_SystemUniqueIDManager.php.inc' => array ( - 'checksum' => '828abf617d95ac1c0d9be47cab34162b61abbc45f9efc5caded9df8145110e3e', + 'checksum' => '02cfaae06ad6d7f43247b1b8776273087944fb4d843a8bcccbcabe3dff908853', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_SystemUniqueIDManager/html/admin.html.inc' => array ( - 'checksum' => 'aecdfcac7197c0c075a9b11f3104b1128991b117205aaf38d2b11c8955198460', + 'checksum' => '04e69aa42256755da2fab671d115bd7f1ac002ae3008edc96fadb5de0bc0adaa', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_SystemUniqueIDManager/html/admin_edit_config.html.inc' => array ( - 'checksum' => '5d2b42f14b4805e63a6662244dbea5b406a22a8ed05e7feba93bc412af3a9792', + 'checksum' => '2150ae85d4ef5c5878e2c8e2833ac64022bec46d06a8e6be8ab8fcbfebb4d898', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Admin_SystemUniqueIDManager/img/icon32.gif' => array ( @@ -12940,24 +12982,24 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKeyListParams.php.inc' => array ( - 'checksum' => 'e9780947f64ebda7496e7e442c148f41cb78d9650f47e192a4cdd114a4c9b514', + 'checksum' => '37a2048dd4c7ceaed7812f8dfdaa96e68ad7f6c5472b3a60cd765b422422f876', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerConfig.php.inc' => array ( - 'checksum' => '38047b171a80f178e841d7e02341c0af4e84751107dd41adcbc7244a9baa1beb', + 'checksum' => '2bbce181e4651b6f9ff288f86a67915df28d199cb3ca3ca724c4f3d402ae9685', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKey.php.inc' => array ( - 'checksum' => 'a5556f5eef1cf7a45328b8f8b2af3b9f84c92e4994ba6163a8aab5ebb2b8633a', + 'checksum' => '50d366ae60933b21a9069a1c6304ff42096fba9533da509a8a390e00cfdc0883', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1.1', ), 'plugin/module/Tool_Login/locale/translation_en.php.inc' => array ( @@ -12996,10 +13038,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_ContentPage/locale/translation_en.php.inc' => array ( - 'checksum' => 'bef0b75a8699624b73c3a4a51664d6d9f5794badeab5e92184713bdcb326f644', + 'checksum' => '86ed1e8d61d5626832f8aae90a61a2dc8e8c08b0b5e69758e4f87b4f71456e01', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.2', + 'version' => '1.0.2.1', ), 'plugin/module/Admin_ContentPage/locale/translation_fr.php.inc' => array ( @@ -13052,10 +13094,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc' => array ( - 'checksum' => '6db8b7fd5f594de0a4378e259dd0cc354a9bbd22fd9f5b3c46913d3152afde0c', + 'checksum' => '880d8b253a9252710f1b35352e160d6fc93351cdf5e3278218d0fe350d89fd1a', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.1.3', + 'version' => '1.1.3.1', ), 'plugin/module/Admin_ContentPage/html/configuration/edit.html.inc' => array ( @@ -13220,10 +13262,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_ContentPage/lib/ContentPage.php.inc' => array ( - 'checksum' => '047685f5e55031f8e00a62d997bc0cbd20c3646d13e78759028d81dd888f3963', + 'checksum' => 'b30f3a4075fd2e1e10bfe4ed65ccafff0957a415c763cd7670046b79e947b4b7', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.1.5.1', + 'version' => '1.1.5.2', ), 'plugin/module/Admin_ContentPage/help/fr/main.html.inc' => array ( @@ -13260,34 +13302,6 @@ $this->integrityCheckResult = array ( 'normalised' => 1, 'version' => '1.0', ), - 'plugin/module/Admin_MessagePanel/locale/translation_fr.php.inc' => - array ( - 'checksum' => '20b071d39cc4601c543ff58153d8701a5aeb5fb56283370d37b4c73ef9ea12a1', - 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', - ), - 'plugin/module/Admin_MessagePanel/html/admin.html.inc' => - array ( - 'checksum' => '04f525a76203e07e6d5faa696112b37d4e3a061086ccde4c85562d11a02a00c8', - 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', - ), - 'plugin/module/Admin_MessagePanel/lib/Admin_MessagePanelItem.php.inc' => - array ( - 'checksum' => '89bcfb22e7183d201c7391fb3b161ba454d709afad6f465334c99e718ad312b7', - 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', - ), - 'plugin/module/Admin_MessagePanel/Admin_MessagePanel.php.inc' => - array ( - 'checksum' => 'efa58dfe93bb736e5693f6b23b97e2be7e63bc9521ecfb39254d5944a526a08e', - 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', - ), 'plugin/module/Content_GenericNews/locale/translation_fr.php.inc' => array ( 'checksum' => 'cd5a21e21458ffffa11ea1c861210c0d043bca6b94885fdba60b8f06c5bc4894', @@ -13395,24 +13409,24 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_ThemeChecker/locale/translation_fr.php.inc' => array ( - 'checksum' => '7a16766c7f3bc1d8debd2bb7e374b4e987aa098b26c3b466fa1c715d6c3b1c81', + 'checksum' => '95e9f335c4ebb877d5a4012ac9fa3f725ff1bf28f0820014be9eea3ad18103e4', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_ThemeChecker/html/admin_checker.html.inc' => array ( - 'checksum' => '27b0d9dce2089cc8bd0e52c2eb5f78af33bc6dcace24aa26b2c7240063e5b7df', + 'checksum' => '17e5a4c23e4715d001f3b3190e4a256207c416ddee5f79362b70462eb7edc9fb', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_ThemeChecker/html/admin_list.html.inc' => array ( - 'checksum' => 'adbfa94b682ce281178e849b981e7319e284fcd13cc460a479c8a0117d8a6890', + 'checksum' => '69fbf14d445955f9f4236b2e68eb8d15719f99d48b1a342051cbd1588a3fa368', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_ThemeChecker/img/icon32.gif' => array ( @@ -13430,10 +13444,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_ThemeChecker/Admin_ThemeChecker.php.inc' => array ( - 'checksum' => '0bb6f771cd14541855f03a9eb8c72d68809b7df196e7a1daef39465a1cd4bed0', + 'checksum' => '5aee1ee7dfe9a0940f2095c2f8c59da6f3389fbabb6f5459046d56d13c3bcf09', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_MonitoringUserAgentChecker/locale/translation_fr.php.inc' => array ( @@ -13871,10 +13885,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericFAQManager/html/admin_edit_family.html.inc' => array ( - 'checksum' => '1a4b72a1a329747a2a15f158576aa707d816a3dc830d18883b88cefc8c44cbf5', + 'checksum' => '49944e10d8a57a7143a7b5d30ab0836bbc3bb9466e9666acc68131c884b39973', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.0', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericFAQManager/html/admin.html.inc' => array ( @@ -13885,10 +13899,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericFAQManager/html/admin_edit_question.html.inc' => array ( - 'checksum' => '0522cd01381f2d4aef0f668397eb2269c283025038c6f5baa4ca7d59e5ed1c85', + 'checksum' => '2494d81555ed815ba002098e4c5450611c987703b3034b5499fb679dbbc28aea', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.0', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericFAQManager/img/icon32.gif' => array ( @@ -13906,10 +13920,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericFAQManager/Admin_GenericFAQManager.php.inc' => array ( - 'checksum' => '72caea774c0024d3749866eda68ee0566bbc644e5384625ac69dd527807aaaa3', + 'checksum' => '6dd7353f196ad5acad46d7dd290896760ea2f2a4f5c87b86a854eeaec66427e4', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.0', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerFamilyListParams.php.inc' => array ( @@ -13920,17 +13934,17 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerQuestion.php.inc' => array ( - 'checksum' => 'f2cb906b1f7c3e3a81c82380e7114dcc74998d5ab658008b395677e2fa3ddfc0', + 'checksum' => 'fbc8bc11fabce4acd6a797c324705c24f3076b4603989c93e6cb9f9a6df6d6be', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.0', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerFamily.php.inc' => array ( - 'checksum' => '483d948af57668b6538277e9824d0a486c05d27f293eb4f14e21cc2861da7cd4', + 'checksum' => '2f00022bede9816b1b503888a891d6c9b5593a3bc5342447bacea400c46a13c9', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.0', + 'version' => '1.0.1', ), 'plugin/module/Admin_GenericFAQManager/lib/Admin_GenericFAQManagerQuestionListParams.php.inc' => array ( @@ -14088,10 +14102,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_SystemNotifications/html/admin.html.inc' => array ( - 'checksum' => '29aa37ff58f7d504005b76450be4e383ff36ba913321d8982cc6cfe41bde36a0', + 'checksum' => '2e6defa53f342866f08daf7ec3b62fad80b589d33174023e69f630904300eb49', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.2', + 'version' => '1.0.2.1', ), 'plugin/module/Admin_SystemNotifications/html/admin_edit_config.html.inc' => array ( @@ -14165,10 +14179,10 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_SystemNotifications/Admin_SystemNotifications.php.inc' => array ( - 'checksum' => '89cd10fc59d9a1bc5eba8a84b16aa9d7ad06050ebca26e4c1d2f505bdc78dab0', + 'checksum' => '1c7fbb70dc9aaac4f350bd9b4ac6e7a04044a91bbe8707dbc811c123a560a674', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.2', + 'version' => '1.0.2.1', ), 'plugin/module/Admin_GooglePoIMapManager/locale/translation_fr.php.inc' => array ( @@ -14291,17 +14305,17 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_ToDoList/locale/translation_fr.php.inc' => array ( - 'checksum' => '4984e657f6f9fcc158bbbb2a39cf4a96d2abb410e4a87f310c724a0b4a6e2171', + 'checksum' => 'a75bf6f5d7ab107d599ba1c51a340588d039d68c8c4de5eb7a0ddf685c88e9f9', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_ToDoList/html/admin.html.inc' => array ( - 'checksum' => 'a1fa7eb6063b4aede483e94dad81e5b531061341e979955d916efa818e9734f9', + 'checksum' => '8a476e28a5d81f51acd36fa8ee6ce8964c7d125aaf506607a7e37f0c823f3fbd', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_ToDoList/img/icon32.gif' => array ( @@ -14319,24 +14333,24 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_ToDoList/lib/Admin_ToDoComment.php.inc' => array ( - 'checksum' => 'ea7bdca59068c01d786973ed286f49ead588efd5631e37f39d326475274f2422', + 'checksum' => '96e52a3ddf1fa5ebefa08e227315825f9cd38f05bc471cec0d4f9a78c903d273', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_ToDoList/lib/Admin_ToDoItem.php.inc' => array ( - 'checksum' => '9dd02ba7acdf6ba8a41718d0fb32d5b85e9ddaf5ac9708795a316cdeed14400f', + 'checksum' => '8fa42ee39c44b87e945fc6ed7346f1518974a56864b9fe42fd5bddb09b614985', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_ToDoList/Admin_ToDoList.php.inc' => array ( - 'checksum' => '7f3b2073379d2bdb4da70a118b8a0850ce23dac810430aa7ae4a39ea48cc22fa', + 'checksum' => '62c5db2df60ffd1a0df4304089df811efb67fa7ec03f00ab9460ed302bb99c7a', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Content_GenericLegalMentions/locale/translation_fr.php.inc' => array ( @@ -14557,24 +14571,24 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_LanguageChecker/locale/translation_fr.php.inc' => array ( - 'checksum' => 'cb9c79d019886a809723fca99ca9f9b505430a3a76da3dba2ef23173fa700dcf', + 'checksum' => '1a280ef5a4c6e1196b053a0537aa720611423e4bbe46fb6caf7ed2ad07a722ad', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_LanguageChecker/html/checker.html.inc' => array ( - 'checksum' => 'bc5a368efba6cf1c74cc0f38208dee26c330e3d7b54860300bd784b18f685636', + 'checksum' => 'a55fc3bf895b8f3c29186d18175c0c2f564e1f9d936bafc0a617eb85ce1dace8', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.0', ), 'plugin/module/Admin_LanguageChecker/html/list.html.inc' => array ( - 'checksum' => '8c394334ef9fcfbd27b097e007b0adb13790510ad2dfd5a9c5b89099b7d67329', + 'checksum' => '597eb32b27bf6488a99e417cf03884abc0eb5b1e22b7ad566d2ba0813624a3ea', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.0', ), 'plugin/module/Admin_LanguageChecker/img/icon32.gif' => array ( @@ -14592,17 +14606,17 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_LanguageChecker/Admin_LanguageChecker.php.inc' => array ( - 'checksum' => '8ed87741f1eabd40df0611ad0f8c01f6b01db794c0576d8464d8bcd099139b4b', + 'checksum' => '90a31528ab9e8f6101ef7994a9ecf8a0008034a00c29ae6a21c7cdc822b138b3', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_LanguageChecker/lib/Admin_LanguageCheckerEngine.php.inc' => array ( - 'checksum' => 'c46ec63e3a814bd3b11519632076f3821bd9c004aa803bb9f6d2605a2fbc5d8f', + 'checksum' => 'eba2d078607ef905fe2365adfec530a2eb675c76f3076350e8ae2cdcf742f642', 'mime' => 'text/x-php', - 'normalised' => 0, - 'version' => '', + 'normalised' => 1, + 'version' => '1.0.1', ), 'plugin/module/Admin_SecurityTools/locale/translation_fr.php.inc' => array ( @@ -14830,17 +14844,17 @@ $this->integrityCheckResult = array ( ), 'plugin/module/Admin_SystemLogManager/html/configuration/edit.html.inc' => array ( - 'checksum' => '7ccc69eba632d38e2ef83bea210edde25c9103fd6ba9a618a3b2df55717aa959', + 'checksum' => 'ab44ebe1a6b3bdb8bb5e9860e015bf69400283d180f14230f2d47530e6a67cfb', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0', + 'version' => '1.0.0.1', ), 'plugin/module/Admin_SystemLogManager/html/configuration/view.html.inc' => array ( - 'checksum' => '63776eae19c486030f59ef1180d78c6683f3cf6ebbb2fa58643f45179e3070ab', + 'checksum' => '29f7df030c9a6a5181ad6eea033fa89a4b35afd6bdd61826d04fde85f67dd39b', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0', + 'version' => '1.0.0.1', ), 'plugin/module/Admin_SystemLogManager/html/admin.html.inc' => array ( @@ -17985,6 +17999,13 @@ $this->integrityCheckResult = array ( 'normalised' => 0, 'version' => '', ), + 'documents/changelogs/Release-20210101.md' => + array ( + 'checksum' => '1af5d2e65dd3a3d56c3a63f139e81f78e808a15bd5e55bce35e4cc80c275e934', + 'mime' => 'text/plain', + 'normalised' => 0, + 'version' => '', + ), 'documents/changelogs/Release-20181201.md' => array ( 'checksum' => '7717b8023ad87e698d624d173695f6ed3382673e764c33bb2dd5d4962332c353', @@ -18330,10 +18351,10 @@ $this->integrityCheckResult = array ( ), 'engine/etc/static.php.inc' => array ( - 'checksum' => '8e8b2f48d38461815be318818ed45635e13c53929fced100e0174581966815fc', + 'checksum' => '85b8e2bfd1b1dae60d8ada21325a9e26cb8b11513f49a5b77f5a06a4b0e3c0fe', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.26', + 'version' => '1.0.27', ), 'engine/etc/neededPlugins.php.inc' => array ( @@ -18505,10 +18526,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/object/Plugin.php.inc' => array ( - 'checksum' => 'a55717157f1f472a94575bcd90a632cab3ae5f995fcf39ce58db91a97b4fa142', + 'checksum' => 'eca2fba3382f40bc44b0e30bd4a5e538bf45ef16424e0d35fa987de2a007224f', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.8', + 'version' => '1.0.8.1', ), 'engine/lib/object/PushNotification.php.inc' => array ( @@ -18652,10 +18673,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Danew.php.inc' => array ( - 'checksum' => '1cb8a78d04fff3d0ddd04c3a10ed61c1f47d665557d1f9dcd177996a4074ab3d', + 'checksum' => 'cb57efbf26436f54c6adc5815b352921ac4532f6d0a51d57d684100571281c95', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.0', + 'version' => '1.0.1', ), 'engine/lib/tool/clientDevices/Altice.php.inc' => array ( @@ -18694,10 +18715,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Alcatel.php.inc' => array ( - 'checksum' => 'eff811ca0f79b5758e8513ff06d407dde11058c1e09ec78f7db46620fd7cfe1e', + 'checksum' => '9dbb03414c630e2d511b87f7f96378050019f9ccc68f0821439581cddd252d5f', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.13', + 'version' => '1.0.14', ), 'engine/lib/tool/clientDevices/Cube.php.inc' => array ( @@ -18708,10 +18729,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Sony.php.inc' => array ( - 'checksum' => '9e5d383e8a31bb5f2d9e6e69ffaab9c69192927f63205cad5db44798940c0231', + 'checksum' => '48e4720996d2c77f8c7d6eb49eea78708541ea2c92a6c13c4adc2d3e2968b39e', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.54', + 'version' => '1.0.55', ), 'engine/lib/tool/clientDevices/KenXinDa.php.inc' => array ( @@ -18734,26 +18755,33 @@ $this->integrityCheckResult = array ( 'normalised' => 1, 'version' => '1.0.2', ), + 'engine/lib/tool/clientDevices/Unknown.php.inc' => + array ( + 'checksum' => 'd8119198c999ce6859414aa7bdb7a15f14b8d68e48e968524a0ae2ae490ee873', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.0', + ), 'engine/lib/tool/clientDevices/Ulefone.php.inc' => array ( - 'checksum' => '2fc937f2c28fdea0b4222f280c06458defe1e8d958bf14330eb7bda3b509c5c3', + 'checksum' => 'e90edb5e8167d9b13751a4c0a8d7cf98c6e5b9e17eedd5595d030459574b4ab0', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.7', + 'version' => '1.0.8', ), 'engine/lib/tool/clientDevices/Tecno.php.inc' => array ( - 'checksum' => '7f739e25b9c79618f29ae2c2590528a5a25e02d0bd27723b3c17f58621c30411', + 'checksum' => 'c072b1a776ed1ee558601a0103b44236470801e87a1dc49ea28cc169cd26f5c0', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.26', + 'version' => '1.0.28', ), 'engine/lib/tool/clientDevices/Doogee.php.inc' => array ( - 'checksum' => '7527ba8576d05b059893c488f5e71b33ee5e8d03f03e8aca143d1f84d6c4b39e', + 'checksum' => '6ac4632e8503a8ce5ab6bf8a6f5032858c03b7fd7128b41e1f0521f45ed362aa', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.13', + 'version' => '1.0.14', ), 'engine/lib/tool/clientDevices/XTigi.php.inc' => array ( @@ -18792,10 +18820,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/LG.php.inc' => array ( - 'checksum' => '1569cbba2b97e61b1a7666935e04c30fde76683abb7ee61d2df4d6122034a609', + 'checksum' => '50c32d65867186a02dec8f535ab4483731c62ebb7d9b41d533ad66138ee55c73', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.38', + 'version' => '1.0.40', ), 'engine/lib/tool/clientDevices/Occulus.php.inc' => array ( @@ -18813,17 +18841,17 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Samsung.php.inc' => array ( - 'checksum' => '7c3a4cea800a67b9348fbad2c580fae2d56da810e6d44b085223e552c3810d0a', + 'checksum' => 'a1797a4d51f88a6aa38c1f879ca90429f4dc406e62a103c620cdc100f8d7bc1b', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.94', + 'version' => '1.0.96', ), 'engine/lib/tool/clientDevices/Wiko.php.inc' => array ( - 'checksum' => 'c4b2c513c13f1aa5799fc2ec5143d8ec22d53c0e5433cf13e51c8262299f3777', + 'checksum' => 'ab106b7b219b1ecdc51cd72039c97883005705538743f038896057f9c18458f8', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.20', + 'version' => '1.0.21', ), 'engine/lib/tool/clientDevices/Memup.php.inc' => array ( @@ -18897,10 +18925,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Leagoo.php.inc' => array ( - 'checksum' => 'fecfba23fe1edfdf7ded930ccbbf34ded39e17746a6b8c4f75345677c6988ed1', + 'checksum' => '8386779616a795f39545de531b9ca1dbb01ea0ce4a12788c9c6be96711a8dad1', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.2', + 'version' => '1.0.3', ), 'engine/lib/tool/clientDevices/Onix.php.inc' => array ( @@ -18932,10 +18960,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Oppo.php.inc' => array ( - 'checksum' => '5afee5349eb3988265abde8166ce4e5db230ff678109ffa3b44e94fecfc3f6a0', + 'checksum' => '9810b12d6ab7206b67ea0df35faec34d3ad571d474451fba22d7ec635b6df8cf', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.34', + 'version' => '1.0.36', ), 'engine/lib/tool/clientDevices/Itel.php.inc' => array ( @@ -18967,10 +18995,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Nokia.php.inc' => array ( - 'checksum' => '28c3af6491a850d931782d15fceec246f85e4c67a92858233f6ec931005c8da1', + 'checksum' => 'ba3363d4b958b3df1703789bec62c393114b6c9eb6763a8a89c61a77ff76179c', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.27', + 'version' => '1.0.28', ), 'engine/lib/tool/clientDevices/Echo.php.inc' => array ( @@ -18981,10 +19009,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Archos.php.inc' => array ( - 'checksum' => 'e604e2763961ee49ab11792441d1879ab63ef66f60ce3c2f963f97915bac4e5f', + 'checksum' => 'e610d4970f3932b56fafdcf5c9a278fd782c517ed64c23a7f71a9f942f00ec45', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.16', + 'version' => '1.0.17', ), 'engine/lib/tool/clientDevices/QMobile.php.inc' => array ( @@ -19016,10 +19044,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Blackview.php.inc' => array ( - 'checksum' => '8891060d36df7e565b121b5eac6011237e2de3dc6821188b8a9e607cc514b401', + 'checksum' => '88e9237724f8c901d6ab54854a5cd40033b64ce93d04fae6b04ac0c88e9adaa8', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.15', + 'version' => '1.0.16', ), 'engine/lib/tool/clientDevices/True.php.inc' => array ( @@ -19037,10 +19065,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Apple.php.inc' => array ( - 'checksum' => '07561ac2551b3ff7d3a143350732cf496bdc5b768c4fbd23458b0db0f59983c7', + 'checksum' => 'db59bdce5cfa9aa6d2b260daafd1b53eac9b7aaefc1e63567627cad6c87b22b9', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.2.1', + 'version' => '1.0.3', ), 'engine/lib/tool/clientDevices/Dexp.php.inc' => array ( @@ -19051,10 +19079,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Vestel.php.inc' => array ( - 'checksum' => 'd4a9b7b34d5d180d1b62eda49e51f5f5f26d3750eccb5c25b1164b636462ad33', + 'checksum' => 'b573d54e1caad6b8103686cbb1d48a6981ee2e312858684ec3096d10cd7bf1df', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.1', + 'version' => '1.0.2', ), 'engine/lib/tool/clientDevices/Verykool.php.inc' => array ( @@ -19107,10 +19135,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Orange.php.inc' => array ( - 'checksum' => '3125c3f221dbb0431045b6a83285610a0e61f63f934c3ec4d09e838cc295efb3', + 'checksum' => 'b9680608ec69357e876017eb49f64e4f04ca44decacd396aee986afe700ecdd2', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.4', + 'version' => '1.0.5', ), 'engine/lib/tool/clientDevices/Coolpad.php.inc' => array ( @@ -19177,10 +19205,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Huawei.php.inc' => array ( - 'checksum' => '14d3bbf888a41921c3a13f0e90814f755fe7ddebd8d212e0e60392f1c3ec743a', + 'checksum' => 'b365d11abca204a5f0c38b009bb3030aa30ea34c4f29f813b02837280b904404', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.84', + 'version' => '1.0.86', ), 'engine/lib/tool/clientDevices/Yotaphone.php.inc' => array ( @@ -19282,10 +19310,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Chuwi.php.inc' => array ( - 'checksum' => '497ef163885333a83208d963584bd6d8a43925c62349a75f515031b97b301791', + 'checksum' => '15ff31ebfab3d717c23dab384f18de7da53d2e431005293e304917fc570af3fb', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.0', + 'version' => '1.0.1', ), 'engine/lib/tool/clientDevices/Quantum.php.inc' => array ( @@ -19415,10 +19443,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Lenovo.php.inc' => array ( - 'checksum' => '3ff6b488cc15e0f409a73558f46b9c6f1f7c04414c86f1214cf1c4a9a6b2fb3d', + 'checksum' => '3ee313d80fdb8470a84ea468d47d8d13f3cfd11837bf33874468ba43c3cc6923', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.28', + 'version' => '1.0.30', ), 'engine/lib/tool/clientDevices/Time2.php.inc' => array ( @@ -19429,10 +19457,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Realme.php.inc' => array ( - 'checksum' => 'fe5f248e183381d0490a2c690b5e0109318b9ec67e232a215f6cd314cc5c48a4', + 'checksum' => '001d2e11e76e9dffb27111ba63a7e9d0c8f7dd5620a6a9f6494c745f827fe654', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.5', + 'version' => '1.0.6', ), 'engine/lib/tool/clientDevices/BQ.php.inc' => array ( @@ -19471,17 +19499,17 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Sharp.php.inc' => array ( - 'checksum' => '1a51d44b3a982d3fd12b31ecc72e3e0f276bd2e79cae9d060b2474254798a8ed', + 'checksum' => 'f2cddc9b6a4cc0efe5d05e9b43d7d901391e653059659f053e70b8a61adb3e1a', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.5', + 'version' => '1.0.6', ), 'engine/lib/tool/clientDevices/Asus.php.inc' => array ( - 'checksum' => '7c3d36fdd6d8243001b153471989680812581fdf2191f62be14658234dbcd049', + 'checksum' => 'ce2cda4c11a14046bc249e4582206877f64e711fb20089e305e9d637a7395f80', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.33', + 'version' => '1.0.34', ), 'engine/lib/tool/clientDevices/Essential.php.inc' => array ( @@ -19520,10 +19548,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Xiaomi.php.inc' => array ( - 'checksum' => 'a7e8ac955ca9c6958d55252761dee89152920f13eea7fa1811eb1374a3e1554f', + 'checksum' => '50fa89d6396205e394ce5aa2e63627c75f229ae4b62a2f04c39355d1cfb8254b', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.48', + 'version' => '1.0.49', ), 'engine/lib/tool/clientDevices/Wortmann.php.inc' => array ( @@ -19616,6 +19644,13 @@ $this->integrityCheckResult = array ( 'normalised' => 1, 'version' => '1.0.0', ), + 'engine/lib/tool/clientDevices/Sumvier.php.inc' => + array ( + 'checksum' => '76a8bd0b661b237086a386ce892c7e9695c9f774591bfadf4a5cd9780b9e97e2', + 'mime' => 'text/x-php', + 'normalised' => 1, + 'version' => '1.0.0', + ), 'engine/lib/tool/clientDevices/EssentielB.php.inc' => array ( 'checksum' => '2982ffd4b92b252f82669c8cd0acac215cf1214ac2d0614a3556837656d9e9ad', @@ -19625,7 +19660,7 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientDevices/Teclast.php.inc' => array ( - 'checksum' => '6763dbbfeb873acfafdc42a89973743b1dcd6ffe2c0bc35a30b952c784e68aeb', + 'checksum' => '205e990bb12bbe869107772d1c6b4e7a416a452221b8392466ba93a3c078ee84', 'mime' => 'text/x-php', 'normalised' => 1, 'version' => '1.0.0', @@ -19709,10 +19744,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientBots/Generics.php.inc' => array ( - 'checksum' => '0d5ee131d979d0ed3c70789b6cf73932896d8853c56d6653dc9fef9d29b8c25c', + 'checksum' => '3835a5ea4effe19cac79519257781adf8849e6107741f0abf4e27ea2c328bb9a', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.24', + 'version' => '1.0.25', ), 'engine/lib/tool/clientBots/Hacks.php.inc' => array ( @@ -19723,10 +19758,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientBots/Tools.php.inc' => array ( - 'checksum' => '413bacf818f339a519991d972580ce740a6762846e5977846f7c07d507a7c4c8', + 'checksum' => 'ed46785359456c2152f7776d8a155e47a64fd8cb25096bb3f43b10b51f526996', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.29', + 'version' => '1.0.30', ), 'engine/lib/tool/clientBots/Before.php.inc' => array ( @@ -19737,17 +19772,17 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/clientBots/Bots.php.inc' => array ( - 'checksum' => 'b38267b84b5b670cb5827ddad8b9d7528235cdf4354366c823b38d3ecef22491', + 'checksum' => '55bae6b7a140fa4b92b2f1067995376d1ac5ef66c7dc7662732d9e41f85b61f8', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.75', + 'version' => '1.0.76', ), 'engine/lib/tool/clientBots/Unknowns.php.inc' => array ( - 'checksum' => '732b85ec2ae0e8d6e92b38ff8a4bbce6e11d39c253ca52e3a3e5c2aa8d78ccd0', + 'checksum' => '9781cb88d9519f5309b39f8e0866e099df478ebcf505c80a58cd067e646223b6', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.28', + 'version' => '1.0.29', ), 'engine/lib/tool/language.php.inc' => array ( @@ -19863,10 +19898,10 @@ $this->integrityCheckResult = array ( ), 'engine/lib/tool/client.php.inc' => array ( - 'checksum' => '9a699f95c0c391e5e43803bee363593fe991c8d665e4319c54ac976bb11329cc', + 'checksum' => '2e1b0e627e3c3127f39a9c858323aca655c0a4f17d3bf45141905e87e414b681', 'mime' => 'text/x-php', 'normalised' => 1, - 'version' => '1.0.128', + 'version' => '1.0.130', ), 'engine/lib/tool/units.php.inc' => array ( diff --git a/plugin/module/Admin_SystemLogManager/html/configuration/edit.html.inc b/plugin/module/Admin_SystemLogManager/html/configuration/edit.html.inc index 99d30982..d590f288 100755 --- a/plugin/module/Admin_SystemLogManager/html/configuration/edit.html.inc +++ b/plugin/module/Admin_SystemLogManager/html/configuration/edit.html.inc @@ -2,12 +2,11 @@ /** * @brief Admin_SystemLogManager Input configuration edit layout * @details Plugin / Input layout - * @file plugin/module/Admin_SystemLogManager/html/configuration/edit.html.inc * @author CaMykS Team - * @version 1.0 + * @version 1.0.0.1 * @date Creation: Jun 2018 - * @date Modification: Jun 2018 - * @copyright 2018 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @cond Exclude @@ -15,9 +14,9 @@ global $camyks; ?> -isConfig):?> +isConfig) : ?> -theme->get_boxContent2Header();?> +theme->get_boxContent2Header(); ?>
@@ -25,28 +24,28 @@ global $camyks;
- get_translation('formitem_rotate');?> + get_translation('formitem_rotate'); ?> - editform->display_selectInput(array('name'=>'logging_period', 'values'=>$this->loggingPeriodList)); ?> + editform->display_selectInput(array('name'=>'logging_period', 'values'=>$this->loggingPeriodList)); ?>
- get_translation('formitem_keeplast');?> + get_translation('formitem_keeplast'); ?> - editform->display_textInput(array('name'=>'logging_lastFilesKept', 'class'=>'vsinputs')); ?> - get_translation('formdesc_keeplast');?> + editform->display_textInput(array('name'=>'logging_lastFilesKept', 'class'=>'vsinputs')); ?> + get_translation('formdesc_keeplast'); ?>
-isConfig):?> +isConfig) : ?>
-theme->get_boxContent2Footer();?> +theme->get_boxContent2Footer(); ?> diff --git a/plugin/module/Admin_SystemLogManager/html/configuration/view.html.inc b/plugin/module/Admin_SystemLogManager/html/configuration/view.html.inc index c25ff4fc..0530998c 100755 --- a/plugin/module/Admin_SystemLogManager/html/configuration/view.html.inc +++ b/plugin/module/Admin_SystemLogManager/html/configuration/view.html.inc @@ -2,12 +2,11 @@ /** * @brief Admin_SystemLogManager Input configuration view layout * @details Plugin / Input layout - * @file plugin/module/Admin_SystemLogManager/html/configuration/view.html.inc * @author CaMykS Team - * @version 1.0 + * @version 1.0.0.1 * @date Creation: Jun 2018 - * @date Modification: Jun 2018 - * @copyright 2018 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @cond Exclude @@ -15,9 +14,9 @@ global $camyks; ?> -isConfig) and $this->isConfig):?> +isConfig) and $this->isConfig) : ?> -theme->get_boxContent2Header();?> +theme->get_boxContent2Header(); ?>
@@ -25,43 +24,43 @@ global $camyks; - + check_right(1) == true) : ?> - +
- get_translation('formitem_rotate');?> + get_translation('formitem_rotate'); ?> - loggingPeriodList[$this->config->get_value('logging_period')];?> + loggingPeriodList[$this->config->get_value('logging_period')]; ?>
- get_translation('formitem_keeplast');?> + get_translation('formitem_keeplast'); ?> - config->get_value('logging_lastFilesKept');?> - get_translation('formdesc_keeplast');?> + config->get_value('logging_lastFilesKept'); ?> + get_translation('formdesc_keeplast'); ?>
-   - +   +
- theme->get_button(array('title'=>$camyks->get_translation('configure'), 'url'=>$this->get_adminLink(array('mode'=>'edit_config')))); ?> - + theme->get_button(array('title'=>$camyks->get_translation('configure'), 'url'=>$this->get_adminLink(array('mode'=>'edit_config')))); ?> +
-isConfig) and $this->isConfig):?> +isConfig) and $this->isConfig) : ?>
-theme->get_boxContent2Footer();?> +theme->get_boxContent2Footer(); ?> diff --git a/plugin/module/Admin_SystemNotifications/Admin_SystemNotifications.php.inc b/plugin/module/Admin_SystemNotifications/Admin_SystemNotifications.php.inc index 2634c390..7c56fedc 100755 --- a/plugin/module/Admin_SystemNotifications/Admin_SystemNotifications.php.inc +++ b/plugin/module/Admin_SystemNotifications/Admin_SystemNotifications.php.inc @@ -4,10 +4,10 @@ *
Gather and display notifications from websites you manage. * @details Plugin / Input Engine * @author CaMykS Team - * @version 1.0.2 + * @version 1.0.2.1 * @date Creation: Jun 2018 - * @date Modification: Sep 2020 - * @copyright 2018 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2018 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -152,7 +152,7 @@ final class Admin_SystemNotifications extends Module { $this->config->get(); /* load mode */ - $this->mode = (isset ($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'); + $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'; switch ($this->mode) { case 'edit_config': @@ -577,6 +577,11 @@ final class Admin_SystemNotifications extends Module { /* load all sites data if master mode */ if ($this->config->vars['module_mode'] == 1) { + /* load current website modules data */ + $modules = array(); + foreach ($camyks->modules as $module) + $modules = array_merge($modules, $module->get_adminInternalNotifications()); + /* initialise follow up list with current website */ $this->followUpList = array( array( @@ -623,7 +628,6 @@ final class Admin_SystemNotifications extends Module { $this->set_redirect($this->get_adminLink()); } - /* Request mode methods */ /** diff --git a/plugin/module/Admin_SystemNotifications/html/admin.html.inc b/plugin/module/Admin_SystemNotifications/html/admin.html.inc index 009dcd34..e85b2ff4 100755 --- a/plugin/module/Admin_SystemNotifications/html/admin.html.inc +++ b/plugin/module/Admin_SystemNotifications/html/admin.html.inc @@ -3,10 +3,10 @@ * @brief Admin_SystemNotifications Module admin main layout * @details Plugin / Module layout * @author CaMykS Team - * @version 1.0.2 + * @version 1.0.2.1 * @date Creation: Jul 2017 - * @date Modification: Sep 2020 - * @copyright 2017 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2017 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -68,68 +68,68 @@ global $camyks; - - - + - - - - - + - - - - - - - - - - - - - <?= $this->get_translation('itempriority_low'); ?> - - <?= $this->get_translation('itempriority_medium'); ?> - - <?= $this->get_translation('itempriority_high'); ?> - - - + + + + + - - + + - -   + + + + + + + + + <?= $this->get_translation('itempriority_low'); ?> + + <?= $this->get_translation('itempriority_medium'); ?> + + <?= $this->get_translation('itempriority_high'); ?> + + - - config->vars['module_mode'] == 1) : ?> - -
- + + +   + + + + + + + config->vars['module_mode'] == 1) : ?> - - -
+
+ + + + +
-
- load_file('html/configuration/view.html.inc');?> -
+
+ load_file('html/configuration/view.html.inc');?> +
- check_right(1) == true and $this->config->vars['module_mode'] == 1) : ?> -
- websiteList->display('head'); ?> - websiteList->display('list'); ?> -
- +check_right(1) == true and $this->config->vars['module_mode'] == 1) : ?> +
+ websiteList->display('head'); ?> + websiteList->display('list'); ?> +
+ help != null) : ?>
diff --git a/plugin/module/Admin_SystemReport/Admin_SystemReport.php.inc b/plugin/module/Admin_SystemReport/Admin_SystemReport.php.inc index 52cc7b69..1a0e9ced 100755 --- a/plugin/module/Admin_SystemReport/Admin_SystemReport.php.inc +++ b/plugin/module/Admin_SystemReport/Admin_SystemReport.php.inc @@ -1,14 +1,13 @@ Monitor and log reports. + *
Monitors and logs reports. * @details Plugin, Module Engine - * @file plugin/module/Admin_SystemReport/Admin_SystemReport.php.inc * @author CaMykS Team - * @version 1.0.3 + * @version 1.0.3.1 * @date Creation: May 2007 - * @date Modification: Dec 2019 - * @copyright 2007 - 2019 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ @@ -29,7 +28,6 @@ final class Admin_SystemReport extends Module { */ public $reportList = array(); - /** * Class constructor. * @param string $path_type @@ -237,7 +235,7 @@ final class Admin_SystemReport extends Module { /* Specific admin mode methods */ /** - * Initialise module object in admin/display mode + * Initialise module object in admin/display mode. * @return void */ private function init_admin_main() { @@ -268,7 +266,7 @@ final class Admin_SystemReport extends Module { } /** - * Initialise module object in admin/readreport mode + * Initialise module object in admin/readreport mode. * @return void */ private function init_admin_readReport() { @@ -417,7 +415,7 @@ final class Admin_SystemReport extends Module { $this->set_redirect($this->get_adminLink()); } - /* specific tool methods */ + /* Specific tool methods */ /** * Create and save a new report. @@ -477,7 +475,7 @@ final class Admin_SystemReport extends Module { } /** - * Return report type list + * Return report type list. * @param boolean $more * @return array */ diff --git a/plugin/module/Admin_SystemUniqueIDManager/Admin_SystemUniqueIDManager.php.inc b/plugin/module/Admin_SystemUniqueIDManager/Admin_SystemUniqueIDManager.php.inc index ccaa279a..38f46552 100755 --- a/plugin/module/Admin_SystemUniqueIDManager/Admin_SystemUniqueIDManager.php.inc +++ b/plugin/module/Admin_SystemUniqueIDManager/Admin_SystemUniqueIDManager.php.inc @@ -1,419 +1,413 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Jan 2015 - * Last Modif Date : Jan 2015 - * History : - * * 15-01-02 : Initial files - * - * Admin_SystemUniqueIDManager - */ - -class Admin_SystemUniqueIDManager extends Module { - /* variables */ - var $uniqueIDItem; - var $uniqueIDList; - - /* - * constructor - * @param string $path_type - */ - function Admin_SystemUniqueIDManager ( $path_type ) { - parent::Module('Admin_SystemUniqueIDManager', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'configuration'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'System'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* load plugin libraries */ - $this->libs[] = 'Admin_SystemUniqueIDManagerKey.php.inc'; - $this->libs[] = 'Admin_SystemUniqueIDManagerConfig.php.inc'; - $this->get_PHPLibs(); - - /* initialise plugin libraries */ - $this->keyItem = new Admin_SystemUniqueIDManagerKey(0, $this); - $this->config = new Admin_SystemUniqueIDManagerConfig('config', $this); - - - /* initialise plugin variables */ - $this->keyList = null; - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - return ( $this->keyItem->install() and parent::install()); - } - - /* - * unintall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - return parent::uninstall(); - } - - /* - * check module installation - * @return boolean result - * @access private - */ - function is_installed () { - return $this->keyItem->is_installed(); - } - - /* - * get module rights - * @return void - * @access private - */ - function get_rights() { - global $camyks; - - $this->rights[0] = array( - 'name' =>'read', - 'title' => $camyks->get_translation('read'), - 'default' => false, - ); - - $this->rights[1] = array( - 'name' =>'write', - 'title' => $camyks->get_translation('write'), - 'default' => false, - ); - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - - /* check read rights */ - if ($this->check_right(0) === false) - return $this->init_admin_accessDenied(); - - /* check dependencies */ - if (!isset($camyks->inputs['TabBuilder'])) - return $this->init_admin_missingPlugin('Input', 'TabBuilder'); - if (!isset($camyks->inputs['AdminItemListViewer'])) - return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); - - /* load config */ - $this->config->get(); - - /* get informations */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'main' ); - - switch ( $this->mode ) { - case 'edit_config': - /* mode == edit_config */ - $this->init_admin_edit_config(); - break; - case 'save_config': - /* mode == save_config */ - $this->init_admin_save_config(); - break; - case 'create_key': - /* mode == create_key */ - $this->init_admin_create_key(); - break; - case 'delete_key': - /* mode == delete_key */ - $this->init_admin_delete_key(); - break; - case 'main': - default: - /* mode == main */ - $this->init_admin_main(); - } - - parent::init_admin(); - } - - /* specific admin mode methods */ - - /* - * init module object in admin/main mode - * @return void - * @access private - */ - function init_admin_main() { - global $camyks; - - /* get help */ - $this->get_help(); - - /* get language to use with content */ - $this->language = $this->get_adminEditionLanguage(); - - /* build uniqueID tab */ - $this->load_file('lib/Admin_SystemUniqueIDManagerKeyListParams.php.inc'); - $this->keyList = &$camyks->inputs['AdminItemListViewer']; - $this->keyList->set_params($this->keyListParams); - $this->keyList->initialise(); - - /* load data */ - $this->generatingMethodList = $this->get_keyGeneratingMethodList(); - $this->totalGeneratedKeys = $this->count_keys(); - $this->freeGeneratedKeys = $this->count_keys(array('status'=>0)); - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - $this->tabBuilder->add_tabs(array( - array( - 'name' => 'Summary', - 'title' => $this->get_translation('formtitle_summary'), - ), - array( - 'name' => 'Keys', - 'title' => $this->get_translation('keys'), - ), - )); - - if ( $this->help != null ) - $this->tabBuilder->add_tab(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - /* initialise tabs */ - $this->tabBuilder->initialise(array('default'=>'Keys')); - - /* get buttons */ - $this->buttons = array(array( - 'link' => $camyks->get_adminLink(), - 'title' => $camyks->get_translation('back'), - )); - } - - /* - * init module object in admin/edit_config mode - * @return void - * @access private - */ - function init_admin_edit_config() { - global $camyks; - - /* get help */ - $this->get_help(); - - /* get tabs */ - $this->tabBuilder = &$camyks->inputs['TabBuilder']; - $this->tabBuilder->add_tab(array( - 'name'=>'Configuration', - 'title'=>$this->get_translation('formtitle_configuration')) - ); - - if ( $this->help != null ) - $this->tabBuilder->add_tab(array('name'=>'help', - 'title'=>$camyks->get_translation('help'))); - - $this->tabBuilder->initialise(array('default'=>'Configuration')); - - /* load data */ - $this->generatingMethodList = $this->get_keyGeneratingMethodList(); - - /* build form */ - $this->editform = new HTMLForm( - 'edit_config', - $this->get_adminlink(array('mode'=>'save_config')), - 'POST'); - $this->editform->set_object($this->config); - - /* get buttons */ - $this->buttons = array( - array( - 'link'=>$this->get_adminLink(), - 'title'=>$camyks->get_translation('back'), - ), - array( - 'link'=>$this->editform->get_HTMLSubmitLink(), - 'title'=>$camyks->get_translation('valid'), - ), - ); - - /* update layout */ - $this->selected_layout = 'admin_edit_config.html.inc'; - } - - /* - * init module object in admin/save_config mode - * @return void - * @access private - */ - function init_admin_save_config() { - global $camyks; - - /* disable admin menu */ - $this->disable_adminEngineMenus(); - - /* save config object */ - $this->config->get_fromHeader(); - if ( $this->config->save() ) { - $this->text = $this->get_translation('config_saved'); - } else { - $this->text = $this->get_translation('config_notsaved'); - } - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect($this->get_adminLink()); - } - - /* - * init module object in admin/create_key mode - * @return void - * @access private - */ - function init_admin_create_key() { - global $camyks; - - /* check user rights */ - if ($this->check_right(1) === false) - return $this->init_admin_actionNotAllowed(); - - /* create object */ - $this->keyItem->initialise(); - if ($this->keyItem->save()) - $this->text = $this->get_translation('key_created'); - else - $this->text = $this->get_translation('key_notcreated'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect($this->get_adminLink(array('openTab'=>'uniqueIDs'))); - } - - /* - * init module object in admin/delete_key mode - * @return void - * @access private - */ - function init_admin_delete_key() { - global $camyks; - - /* check user rights */ - if ($this->check_right(1) === false) - return $this->init_admin_actionNotAllowed(); - - /* delete object */ - $this->keyItem->id = isset($_REQUEST['key_id'])?(int)$_REQUEST['key_id']:0; - $this->keyItem->get(); - $this->keyItem->get_fromItems(); - if ($this->keyItem->is_deletable() and $this->keyItem->delete()) - $this->text = $this->get_translation('key_deleted'); - else - $this->text = $this->get_translation('key_notdeleted'); - - /* update layout */ - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect($this->get_adminLink(array('openTab'=>'uniqueIDs'))); - } - - /* specific content management methods */ - - /* - * return single uniqueID list - * @return array - * @access public - */ - function get_keyStatusList() { - return $this->keyItem->get_statusList(); - } - - /* - * return uniqueIDs status list - * @param boolean $more - * @return array - * @access private - */ - function get_keysStatusList($more=false) { - return $this->keyItem->get_multiStatusList($more); - } - - /* - * return unique ID generating method list - * @return array - * @access private - */ - function get_keyGeneratingMethodList() { - return $this->keyItem->get_generatingMethodList(); - } - - /* - * return uniqueID count - * @param array $params - * @return integer - * @access private - */ - function count_keys($params=array()) { - return $this->keyItem->count($params); - } - - /* - * return uniqueID list - * @param array $params - * @return array - * @access private - */ - function get_keyList($params=array()) { - return $this->keyItem->get_list($params); - } - - /* external request methods */ - - /* - * return new unique ID - * @param string $plugin - * @param string $object - * @return mixed // unique ID on success, false on failure - * @access public - */ - function get_newUniqueID($plugin, $object) { - if (!$this->keyItem->load_freeItem()) - $this->keyItem->initialise(); - $this->keyItem->_libItems['plugin']->value = $plugin; - $this->keyItem->_libItems['object']->value = $object; - if ($this->keyItem->save()) { - $this->keyItem->get_fromItems(); - return $this->keyItem->vars['uniqueID']; - } - return false; - } - - /* - * return given config item value - * @param string $item - * @return mixed - * @access private - */ - function get_configValue($item) { - if (!isset($this->config->vars)) - $this->config->get(); - if (isset($this->config->vars[$item])) - return $this->config->vars[$item]; - return false; - } -} -?> \ No newline at end of file + Provides unique ids on requests. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1.1 + * @date Creation: Jan 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_SystemUniqueIDManager class. + */ +final class Admin_SystemUniqueIDManager extends Module { + /** + * var Object $keyItem + * @brief Unique id object. + */ + public $keyItem; + + /** + * var array $uniqueIDList + * @brief Unique id list. + */ + public $keyList = null; + + /** + * var Object $config + * @brief Plugin configuration. + */ + protected $config; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_SystemUniqueIDManager', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'System'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'configuration'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load plugin libraries */ + $this->load_library('Admin_SystemUniqueIDManagerKey'); + $this->load_library('Admin_SystemUniqueIDManagerConfig'); + + /* Initialise plugin libraries */ + $this->keyItem = new Admin_SystemUniqueIDManagerKey(0, $this); + $this->config = new Admin_SystemUniqueIDManagerConfig('config', $this); + } + + /* Override Module methods */ + + /** + * Install module. + * @return boolean success + */ + public function install() { + return ($this->keyItem->install() and parent::install()); + } + + /** + * Unintall module. + * @return boolean success + */ + public function uninstall() { + return parent::uninstall(); + } + + /** + * Check module installation. + * @return boolean result + */ + public function is_installed() { + return $this->keyItem->is_installed(); + } + + /** + * Define module permissions. + * @return void + */ + public function get_rights() { + global $camyks; + + $this->rights[0] = array( + 'name' =>'read', + 'title' => $camyks->get_translation('read'), + 'default' => false, + ); + + $this->rights[1] = array( + 'name' =>'write', + 'title' => $camyks->get_translation('write'), + 'default' => false, + ); + } + + /** + * Initialise module object in admin mode + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check read rights */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Check dependencies */ + if (!isset($camyks->inputs['TabBuilder'])) + return $this->init_admin_missingPlugin('Input', 'TabBuilder'); + if (!isset($camyks->inputs['AdminItemListViewer'])) + return $this->init_admin_missingPlugin('Input', 'AdminItemListViewer'); + + /* Load configuration */ + $this->config->get(); + + /* Load action to execute */ + $this->mode = isset ($_REQUEST['mode']) ? $_REQUEST['mode'] : 'main'; + + switch ($this->mode) { + case 'edit_config': + /* mode == edit_config */ + $this->init_admin_edit_config(); + break; + case 'save_config': + /* mode == save_config */ + $this->init_admin_save_config(); + break; + case 'create_key': + /* mode == create_key */ + $this->init_admin_create_key(); + break; + case 'delete_key': + /* mode == delete_key */ + $this->init_admin_delete_key(); + break; + case 'main': + default: + /* mode == main */ + $this->init_admin_main(); + } + + /* Perform generic initialisation */ + parent::init_admin(); + } + + /* Specific admin mode methods */ + + /** + * Initialise module object in admin/main mode + * @return void + */ + private function init_admin_main() { + global $camyks; + + /* Load help */ + $this->get_help(); + + /* Load language to use with content */ + $this->language = $this->get_adminEditionLanguage(); + + /* Build uniqueID tab */ + $this->load_library('Admin_SystemUniqueIDManagerKeyListParams'); + $this->keyList = &$camyks->inputs['AdminItemListViewer']; + $this->keyList->set_params($this->keyListParams); + $this->keyList->initialise(); + + /* Load data */ + $this->generatingMethodList = $this->get_keyGeneratingMethodList(); + $this->totalGeneratedKeys = $this->count_keys(); + $this->freeGeneratedKeys = $this->count_keys(array('status'=>0)); + + /* Build tabs */ + $this->tabBuilder = $camyks->get_input('TabBuilder'); + $this->tabBuilder->add_tabs(array( + array( + 'name' => 'Summary', + 'title' => $this->get_translation('formtitle_summary'), + ), + array( + 'name' => 'Keys', + 'title' => $this->get_translation('keys'), + ), + )); + + if ($this->help != null) + $this->tabBuilder->add_tab(array( + 'name' => 'help', + 'title' => $camyks->get_translation('help'), + )); + + /* Initialise tabs */ + $this->tabBuilder->initialise(array('default'=>'Keys')); + + /* Load buttons */ + $this->buttons = array(array( + 'link' => $camyks->get_adminLink(), + 'title' => $camyks->get_translation('back'), + )); + } + + /** + * Initialise module object in admin/edit_config mode + * @return void + */ + private function init_admin_edit_config() { + global $camyks; + + /* Load help */ + $this->get_help(); + + /* Build tabs */ + $this->tabBuilder = &$camyks->get_input('TabBuilder'); + $this->tabBuilder->add_tab(array( + 'name' => 'Configuration', + 'title' => $this->get_translation('formtitle_configuration')) + ); + + if ($this->help != null) + $this->tabBuilder->add_tab(array( + 'name' => 'help', + 'title' => $camyks->get_translation('help'), + )); + $this->tabBuilder->initialise(array('default'=>'Configuration')); + + /* Load data */ + $this->generatingMethodList = $this->get_keyGeneratingMethodList(); + + /* Build form */ + $this->editform = new HTMLForm('edit_config', $this->get_adminlink(array('mode'=>'save_config')), 'POST'); + $this->editform->set_object($this->config); + + /* Build buttons */ + $this->buttons = array( + array( + 'link' => $this->get_adminLink(), + 'title' => $camyks->get_translation('back'), + ), + array( + 'link' => $this->editform->get_HTMLSubmitLink(), + 'title' => $camyks->get_translation('valid'), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_edit_config.html.inc'); + } + + /** + * Initialise module object in admin/save_config mode. + * @return void + */ + private function init_admin_save_config() { + global $camyks; + + /* Disable admin menu */ + $this->disable_adminEngineMenus(); + + /* Save config object */ + $this->config->get_fromHeader(); + if ($this->config->save()) { + $this->text = $this->get_translation('config_saved'); + } else { + $this->text = $this->get_translation('config_notsaved'); + } + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink()); + } + + /** + * Initialise module object in admin/create_key mode. + * @return void + */ + private function init_admin_create_key() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Create object */ + $this->keyItem->initialise(); + if ($this->keyItem->save()) + $this->text = $this->get_translation('key_created'); + else + $this->text = $this->get_translation('key_notcreated'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('openTab'=>'uniqueIDs'))); + } + + /** + * Initialise module object in admin/delete_key mode. + * @return void + */ + private function init_admin_delete_key() { + global $camyks; + + /* Check user permission */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* Delete object */ + $this->keyItem->id = isset($_REQUEST['key_id']) ? (int)$_REQUEST['key_id'] : 0; + $this->keyItem->get(); + $this->keyItem->get_fromItems(); + if ($this->keyItem->is_deletable() and $this->keyItem->delete()) + $this->text = $this->get_translation('key_deleted'); + else + $this->text = $this->get_translation('key_notdeleted'); + + /* Update layout */ + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('openTab'=>'uniqueIDs'))); + } + + /* Specific content management methods */ + + /** + * Return single key status list. + * @return array + */ + protected function get_keyStatusList() { + return $this->keyItem->get_statusList(); + } + + /** + * Return keys status list. + * @param boolean $more + */ + protected function get_keysStatusList($more=false) { + return $this->keyItem->get_multiStatusList($more); + } + + /** + * Return keys generating method list. + * @return array + */ + protected function get_keyGeneratingMethodList() { + return $this->keyItem->get_generatingMethodList(); + } + + /** + * Return keys count. + * @param array $params + * @return integer + */ + public function count_keys($params=array()) { + return $this->keyItem->count($params); + } + + /** + * Return key list. + * @param array $params + * @return array + */ + public function get_keyList($params=array()) { + return $this->keyItem->get_list($params); + } + + /* External request methods */ + + /** + * Return new unique ID. + * @param string $plugin + * @param string $object + * @return mixed // unique ID on success, false on failure + */ + public function get_newUniqueID($plugin, $object) { + if (!$this->keyItem->load_freeItem()) + $this->keyItem->initialise(); + $this->keyItem->_libItems['plugin']->value = $plugin; + $this->keyItem->_libItems['object']->value = $object; + if ($this->keyItem->save()) { + $this->keyItem->get_fromItems(); + return $this->keyItem->vars['uniqueID']; + } + return false; + } + + /** + * Return given config item value. + * @param string $item + * @return mixed + */ + public function get_configValue($item) { + if (!isset($this->config->vars)) + $this->config->get(); + if (isset($this->config->vars[$item])) + return $this->config->vars[$item]; + return false; + } +} +?> diff --git a/plugin/module/Admin_SystemUniqueIDManager/html/admin.html.inc b/plugin/module/Admin_SystemUniqueIDManager/html/admin.html.inc index 6d041643..bef165e8 100755 --- a/plugin/module/Admin_SystemUniqueIDManager/html/admin.html.inc +++ b/plugin/module/Admin_SystemUniqueIDManager/html/admin.html.inc @@ -1,126 +1,117 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Jan 2015 - * Last Modif Date : Jan 2015 - * - * Admin_SystemUniqueIDManager Module Admin Layout : main -*/ -global $camyks; -?> -theme->get_boxHeader('width:800px;margin:0 auto;');?> -theme->get_boxTitleBar($this->title) ?> -theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header( )?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('formtitle_configuration'); ?> -
- get_translation('formtitle_generating'); ?> -
- get_translation('formitem_method');?> - - generatingMethodList[$this->config->vars['generating_method']]; ?> - - theme->get_button(array('title'=>$camyks->get_translation('modify'), - 'url'=>$this->get_adminLink(array('mode'=>'edit_config')))); ?> -
- get_translation('formitem_keylength');?> - - config->vars['generating_length']; ?> -
- get_translation('formitem_maxattempts');?> - - config->vars['generating_maxAttempts']; ?> -
-   -
- get_translation('formtitle_summary'); ?> -
- get_translation('formitem_generatedkeys');?> - - totalGeneratedKeys; ?> - - theme->get_button(array('title'=>$this->get_translation('generate_freekeys'), - 'url'=>$this->get_adminLink(array('mode'=>'generate_keys')))); ?> - */ ?> -
- get_translation('formitem_freegeneratedkeys');?> - - freeGeneratedKeys; ?> -
- -
- -
- -keyList->display('head');?> -keyList->display('list');?> - -
- -help != null ) : ?> -
-display_help(); ?> -
- - -theme->get_boxContent2Footer( )?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1.1 + * @date Creation: Jan 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header(); ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_configuration'); ?> +
+ get_translation('formtitle_generating'); ?> +
+ get_translation('formitem_method'); ?> + + generatingMethodList[$this->config->vars['generating_method']]; ?> + + theme->get_button(array( + 'title' => $camyks->get_translation('modify'), + 'url' => $this->get_adminLink(array('mode'=>'edit_config')), + )); ?> +
+ get_translation('formitem_keylength'); ?> + + config->vars['generating_length']; ?> +
+ get_translation('formitem_maxattempts'); ?> + + config->vars['generating_maxAttempts']; ?> +
+   +
+ get_translation('formtitle_summary'); ?> +
+ get_translation('formitem_generatedkeys'); ?> + + totalGeneratedKeys; ?> + + theme->get_button(array('title'=>$this->get_translation('generate_freekeys'), + 'url'=>$this->get_adminLink(array('mode'=>'generate_keys')))); ?> + */ ?> +
+ get_translation('formitem_freegeneratedkeys'); ?> + + freeGeneratedKeys; ?> +
+
+ +
+ keyList->display('head'); ?> + keyList->display('list'); ?> +
+ +help != null) : ?> +
+ display_help(); ?> +
+ + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_SystemUniqueIDManager/html/admin_edit_config.html.inc b/plugin/module/Admin_SystemUniqueIDManager/html/admin_edit_config.html.inc index eb0afd7e..c6d3db5a 100755 --- a/plugin/module/Admin_SystemUniqueIDManager/html/admin_edit_config.html.inc +++ b/plugin/module/Admin_SystemUniqueIDManager/html/admin_edit_config.html.inc @@ -1,77 +1,76 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Creation Date : Apr 2016 - * Last Modif Date : Apr 2016 - * - * Admin_SystemUniqueIDManager Module Admin Layout : main -*/ -global $camyks; -?> -theme->get_boxHeader('width:800px; margin:0 auto;');?> -theme->get_boxTitleBar($this->title) ?> -theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams);?> -theme->get_boxContent2Header( )?> - -editform->display_header(); ?> -editform->display_hiddens(); ?> - -
- - - - - - - - - - - - - - - - - - - - - - - -
- get_translation('formtitle_configuration'); ?> -
- get_translation('formtitle_generating'); ?> -
- get_translation('formitem_method');?> - - editform->display_selectInput(array('name'=>'generating_method', 'values'=>$this->generatingMethodList)); ?> -
- get_translation('formitem_keylength');?> - - editform->display_textInput(array('name'=>'generating_length')); ?> -
- get_translation('formitem_maxattempts');?> - - editform->display_textInput(array('name'=>'generating_maxAttempts')); ?> -
-
- -editform->display_footer(); ?> - -help != null ) : ?> -
-display_help(); ?> -
- - -theme->get_boxContent2Footer( )?> -theme->get_boxButtonsBar($this->buttons); ?> -theme->get_boxFooter(); ?> + + * @version 1.0.1.1 + * @date Creation: Apr 2016 + * @date Modification: Jan 2021 + * @copyright 2016 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabBuilder->tabs, $this->tabBuilder->jsParams); ?> +theme->get_boxContent2Header(); ?> + +editform->display_header(); ?> +editform->display_hiddens(); ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ get_translation('formtitle_configuration'); ?> +
+ get_translation('formtitle_generating'); ?> +
+ get_translation('formitem_method'); ?> + + editform->display_selectInput(array('name'=>'generating_method', 'values'=>$this->generatingMethodList)); ?> +
+ get_translation('formitem_keylength'); ?> + + editform->display_textInput(array('name'=>'generating_length')); ?> +
+ get_translation('formitem_maxattempts'); ?> + + editform->display_textInput(array('name'=>'generating_maxAttempts')); ?> +
+
+ +editform->display_footer(); ?> + +help != null) : ?> +
+ display_help(); ?> +
+ + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerConfig.php.inc b/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerConfig.php.inc index 59180dd8..57f584d8 100755 --- a/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerConfig.php.inc +++ b/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerConfig.php.inc @@ -1,34 +1,36 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Config - * Creation Date : Jan 2015 - * Last Modif Date : Jan 2015 - * - * Admin_SystemUniqueIDManagerConfig configuration file +/** + * @brief Admin_SystemUniqueIDManager Module configuration library + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jan 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -class Admin_SystemUniqueIDManagerConfig extends ModuleConfig { - /* - * constructor - * @param string $name - * @param Module $parent - */ - function Admin_SystemUniqueIDManagerConfig ( $name, &$parent ) { - parent::ModuleConfig($name, $parent); - - /* generating */ - $this->add_newItem('generating_method', 'integer', 0); - $this->add_newItem('generating_length', 'integer', 10); - $this->add_newItem('generating_maxAttempts', 'integer', 25); - - - /* generic initialisation */ - parent::init_config(); - } +/** + * Admin_SystemUniqueIDManagerConfig class. + */ +final class Admin_SystemUniqueIDManagerConfig extends PluginConfig { + /** + * Class constructor. + * @param string $name + * @param Module $parent + * @return void + */ + public function __construct($name, &$parent) { + parent::__construct($name, $parent); + + /* Generating attributes */ + $this->add_newItem('generating_method', 'integer', 0); + $this->add_newItem('generating_length', 'integer', 10); + $this->add_newItem('generating_maxAttempts', 'integer', 25); + + /* Perform generic initialisation */ + parent::init_config(); + } } ?> \ No newline at end of file diff --git a/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKey.php.inc b/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKey.php.inc index 9ea0e939..94ee25e2 100755 --- a/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKey.php.inc +++ b/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKey.php.inc @@ -1,254 +1,249 @@ - - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Library - * Creation Date : Jan 2015 - * Last Modif Date : Jan 2015 - * - * Admin_SystemUniqueIDManagerKey object for Admin_SystemUniqueIDManager Module - */ - -class Admin_SystemUniqueIDManagerKey extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_SystemUniqueIDManagerKey ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - - /* admin items */ - $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); - $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); - $this->add_newItem('uniqueID', 'db', 'text', 'varchar', 32, ''); - $this->add_newItem('plugin', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('object', 'db', 'text', 'varchar', 16, ''); - - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary method */ - - /* - * check object data - * @return boolean success - * @access private - */ - function check_data() { - /* check object status from data */ - if ( $this->_libItems['plugin']->value != '' and $this->_libItems['object']->value != '') - $this->_libItems['status']->value = 1; - - /* add creating date */ - if ($this->id == 0) - $this->_libItems['cdate']->value = time(); - - /* check for generating a new unique id*/ - if ($this->_libItems['uniqueID']->value == '') - return ($this->generate_uniqueIdValue()); - return true; - } - - /* - * build sql condition for lists - * @param array $params - * @return string - * @access public - */ - function build_SQLCondition($params) { - $search = array(); - if ( isset( $params['status']) and $params['status']!='' and $params['status'] > -1 ) - $search[] = 'status='.$params['status']; - return implode(' and ', $search); - } - - /* specific properties definition method */ - - /* - * return status list - * @return array - * @access private - */ - function get_statusList() { - return array( - 0 => $this->get_translation('keystatus_free'), - 1 => $this->get_translation('keystatus_used'), - ); - } - - /* - * return multi object status list - * @param boolean $more - * @return array - * @access private - */ - function get_multiStatusList($more=false) { - $list = array(); - if ($more) - $list['-1'] = $this->get_translation('keys_all'); - $list['0'] = $this->get_translation('keysstatus_free'); - $list['1'] = $this->get_translation('keysstatus_useded'); - return $list; - } - - /* - * return generating method list - * @return array - * @access public - */ - function get_generatingMethodList() { - return array( - 0 => $this->get_translation('keygeneratingmethod_md5'), - 1 => $this->get_translation('keygeneratingmethod_crc32'), - 2 => $this->get_translation('keygeneratingmethod_sha'), - 3 => $this->get_translation('keygeneratingmethod_uniqid'), - ); - } - - /* specific tool methods */ - - /* - * load free item from database - * @return boolean success - * @access private - */ - function load_freeItem() { - $l = $this->get_list(array('status'=>0, 'limit'=>1)); - if ( count($l) == 0) - return false; - - foreach ($l as $i) { - $this->id = $i->id; - $this->get_fromArray($i->vars); - $this->get_fromItems(); - } - - return true; - } - - /* - * check if object is deletable - * @return boolean result - * @access public - */ - function is_deletable() { - /* check plugin and object values */ - if ($this->vars['plugin'] == '' or $this->vars['object'] == '') - return true; - - /* check plugin and object objects */ - - /* key is still in use, do not delete */ - return false; - } - - /* - * return object list - * @param array $params - * @return array - * @access private - */ - function get_list($params=array()) { - global $camyks; - - /* default params list */ - $dParams = array('status'=>-1, 'language'=>$camyks->current_language, - 'limit'=>-1, 'count'=>-1, 'order'=>'sortPosition', 'orderway'=>'asc'); - /* merge params */ - $params = array_merge($dParams, $params); - /* build where statement */ - $w = $this->build_whereStatement($params); - /* return list */ - return $this->get_objectList($params['language'], $w, $params['limit'], $params['count'], $params['order'], $params['orderway']); - } - - /* - * return uniqueID count with given params - * @params array $params - * @return array - * @access private - */ - function count($params=array()) { - global $camyks; - $p = array('status'=>-1,); - $params = array_merge($p, $params); - $where = $this->build_whereStatement($params); - - /* return result */ - return $this->get_objectCount($where); - } - - /* - * build where statement from params - * @param array $params - * @return string - * @access private - */ - function build_whereStatement($params=array()) { - $w = array(); - - /* check status */ - if ($params['status'] != -1) - $w[] = 'status = '.$params['status']; - - /* return result */ - return implode(' and ', $w); - } - - /* - * return config value - * @param mixed $param - * @return string - * @access private - */ - function get_configValue($param=array()) { - return $this->_libParent->get_configValue($param); - } - - /* - * generate a new unique key - * @return mixed - * @access private - */ - function generate_uniqueIdValue() { - $c = 0; - /* check if max attempts limit is exceeded */ - while($c++ < $this->get_configValue('generating_maxAttempts')) { - /* generate code from selected method */ - switch ($this->get_configValue('generating_method')) { - case 0: $code = md5(session_id().microtime()); break; - case 1 : $code = abs(crc32(session_id().microtime())); break; - case 2 : $code = sha1(session_id().microtime()); break; - case 3 : $code = uniqid(null, true); break; - } - - /* truncate value to defined max length */ - $code = substr($code, 0, $this->get_configValue('generating_length')); - - /* check if exists in database */ - $sql = 'select uniqueID from '.$this->_libSQLTable; - $sql .= ' where uniqueID = "'.$code.'"'; - if ($this->execute_DBQuery($sql, __LINE__, __FILE__)) { - if (!$this->get_DBQueryDataLine()) { - $this->_libItems['uniqueID']->value = $code; - return true; - } - } - - /* make a pause to change the microtime value */ - usleep(20); - } - - /* attempt limit exceeded */ - $camyks->log_executionerror($this, $this->get_translation('keygenerator_attemptlimitexceeded')); - - /* attempts limit exceeded, return failure */ - return false; - } -} -?> \ No newline at end of file + + * @version 1.0.1.1 + * @date Creation: Jan 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_SystemUniqueIDManagerKey class. + */ +final class Admin_SystemUniqueIDManagerKey extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Define attributes */ + $this->add_newItem('status', 'db', 'int', 'tinyint unsigned', '', 0); + $this->add_newItem('cdate', 'db', 'date', 'bigint unsigned', '', time()); + $this->add_newItem('uniqueID', 'db', 'text', 'varchar', 32, ''); + $this->add_newItem('plugin', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('object', 'db', 'text', 'varchar', 16, ''); + + /* Perform generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary method */ + + /** + * Check object data + * @return boolean success + */ + public function check_data() { + /* Check object status from data */ + if ($this->_libItems['plugin']->value != '' and $this->_libItems['object']->value != '') + $this->_libItems['status']->value = 1; + + /* Set creating date */ + if ($this->id == 0) + $this->_libItems['cdate']->value = time(); + + /* Check for generating a new unique id*/ + if ($this->_libItems['uniqueID']->value == '') + return ($this->generate_uniqueIdValue()); + return true; + } + + /** + * Build sql condition for lists. + * @param array $params + * @return string + */ + public function build_SQLCondition($params) { + $search = array(); + if (isset($params['status']) and $params['status']!='' and $params['status'] > -1) + $search[] = 'status='.$params['status']; + return implode(' and ', $search); + } + + /* Specific properties definition method */ + + /** + * Return status list. + * @return array + */ + public function get_statusList() { + return array( + 0 => $this->get_translation('keystatus_free'), + 1 => $this->get_translation('keystatus_used'), + ); + } + + /** + * Return multi object status list. + * @param boolean $more + * @return array + */ + public function get_multiStatusList($more=false) { + $list = array(); + if ($more) + $list['-1'] = $this->get_translation('keys_all'); + $list['0'] = $this->get_translation('keysstatus_free'); + $list['1'] = $this->get_translation('keysstatus_used'); + return $list; + } + + /** + * Return generating method list. + * @return array + */ + public function get_generatingMethodList() { + return array( + 0 => $this->get_translation('keygeneratingmethod_md5'), + 1 => $this->get_translation('keygeneratingmethod_crc32'), + 2 => $this->get_translation('keygeneratingmethod_sha'), + 3 => $this->get_translation('keygeneratingmethod_uniqid'), + ); + } + + /* Specific tool methods */ + + /** + * Load free item from database. + * @return boolean success + */ + public function load_freeItem() { + $l = $this->get_list(array('status'=>0, 'limit'=>1)); + if (count($l) == 0) + return false; + + foreach ($l as $i) { + $this->id = $i->id; + $this->get_fromArray($i->vars); + $this->get_fromItems(); + } + + return true; + } + + /** + * Check if object is deletable. + * @return boolean result + */ + public function is_deletable() { + /* Check plugin and object values */ + if ($this->vars['plugin'] == '' or $this->vars['object'] == '') + return true; + + /* Check plugin and object objects */ + + /* Key is still in use, do not delete */ + return false; + } + + /** + * Return object list. + * @param array $params + * @return array + */ + public function get_list($params=array()) { + global $camyks; + + /* Default params list */ + $dParams = array('status'=>-1, 'language'=>$camyks->current_language, 'limit'=>-1, 'count'=>-1, 'order'=>'sortPosition', 'orderway'=>'asc'); + + /* Merge params */ + $params = array_merge($dParams, $params); + + /* Build where statement */ + $where = $this->build_whereStatement($params); + + /* Return list */ + return $this->get_objectList($params['language'], $where, $params['limit'], $params['count'], $params['order'], $params['orderway']); + } + + /** + * Return uniqueID count with given params. + * @param array $params + * @return array + */ + public function count($params=array()) { + global $camyks; + $p = array('status'=>-1,); + $params = array_merge($p, $params); + $where = $this->build_whereStatement($params); + + /* Return result */ + return $this->get_objectCount($where); + } + + /** + * Build where statement from params. + * @param array $params + * @return string + */ + private function build_whereStatement($params=array()) { + $w = array(); + + /* Check status */ + if ($params['status'] != -1) + $w[] = 'status = '.$params['status']; + + /* Return result */ + return implode(' and ', $w); + } + + /** + * Return config value. + * @param mixed $param + * @return string + */ + private function get_configValue($param=array()) { + return $this->_libParent->get_configValue($param); + } + + /** + * Generate a new unique key. + * @return mixed + */ + public function generate_uniqueIdValue() { + $c = 0; + + /* Check if max attempts limit is exceeded */ + while($c++ < $this->get_configValue('generating_maxAttempts')) { + + /* Generate code from selected method */ + switch ($this->get_configValue('generating_method')) { + case 0: $code = md5(session_id().microtime()); break; + case 1: $code = abs(crc32(session_id().microtime())); break; + case 2: $code = sha1(session_id().microtime()); break; + case 3: $code = uniqid(null, true); break; + } + + /* Truncate value to defined max length */ + $code = substr($code, 0, $this->get_configValue('generating_length')); + + /* Check if exists in database */ + $sql = 'select uniqueID from '.$this->_libSQLTable; + $sql .= ' where uniqueID = "'.$code.'"'; + if ($this->execute_DBQuery($sql, __LINE__, __FILE__)) { + if (!$this->get_DBQueryDataLine()) { + $this->_libItems['uniqueID']->value = $code; + return true; + } + } + + /* Make a pause to change the microtime value */ + usleep(20); + } + + /* Attempt limit exceeded */ + $camyks->log_executionerror($this, $this->get_translation('keygenerator_attemptlimitexceeded')); + + /* Attempts limit exceeded, return failure */ + return false; + } +} +?> diff --git a/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKeyListParams.php.inc b/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKeyListParams.php.inc index 0081b266..6251842b 100755 --- a/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKeyListParams.php.inc +++ b/plugin/module/Admin_SystemUniqueIDManager/lib/Admin_SystemUniqueIDManagerKeyListParams.php.inc @@ -1,15 +1,14 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Creation Date : Jan 2015 - * Last Modif Date : Jun 2017 - * - * Admin_SystemUniqueIDManager uniqueID list parameters +/** + * @brief Admin_SystemUniqueIDManager Module key list parameters + * @details Plugin, Module Library + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jan 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ global $camyks; @@ -26,28 +25,27 @@ $this->keyListParams = array('name'=>'uniqueIDList', 'useSession'=>true, 'object /* build head parameters */ $this->keyListParams['headselectors'] = array( - 'page'=> array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), - 'status'=> array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->keysStatusList, 'default'=>'-1'), + 'page' => array('title'=>$camyks->get_translation('formitem_page'), 'itemtype'=>'page'), + 'status' => array('title'=>$camyks->get_translation('formitem_status'), 'itemtype'=>'select', 'values'=>$this->keysStatusList, 'default'=>'-1'), ); /* build sort parameters */ $this->keyListParams['sort'] = array('allowed'=>true, 'default'=>'cdate', 'defaultway'=>'desc'); /* build master action parameters */ -if ($this->check_right(1)==true) +if ($this->check_right(1)) $this->keyListParams['listlinks'] = array('new'=>array('title'=>$this->get_translation('addnewuniqueid'), 'icon'=>'plus', 'url_value'=>$this->get_adminLink(array('mode'=>'create_key')), 'titlecolumn'=>'cdate', 'buttoncolumn'=>'delete')); /* build column parameters */ $this->keyListParams['listcolumns'] = array( - 'status'=>array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), - 'cdate'=>array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numericwithhours'), - 'uniqueID'=>array('title'=>$this->get_translation('key'), 'columntype'=>'text', 'maxlength'=>'48'), - 'plugin'=>array('title'=>$this->get_translation('plugin'), 'columntype'=>'text'), - 'object'=>array('title'=>$this->get_translation('object'), 'columntype'=>'text', 'maxlength'=>96), + 'status' => array('title'=>' ', 'columntype'=>'boolean', 'mode'=>'pict', 'style'=>'width:12px;'), + 'cdate' => array('title'=>$camyks->get_translation('date'), 'columntype'=>'date', 'mode'=>'numericwithhours'), + 'uniqueID' => array('title'=>$this->get_translation('key'), 'columntype'=>'text', 'maxlength'=>'48'), + 'plugin' => array('title'=>$this->get_translation('plugin'), 'columntype'=>'text'), + 'object' => array('title'=>$this->get_translation('object'), 'columntype'=>'text', 'maxlength'=>96), ); /* build object action parameters */ -if ($this->check_right(1)==true) +if ($this->check_right(1)) $this->keyListParams['listcolumns']['delete'] = array('title'=>' ', 'columntype'=>'button', 'icon'=>'cross', 'url_value'=>$this->deleteKeyLink, 'style'=>'width:12px;', 'url_title'=>$this->get_translation('deletekey')); - ?> \ No newline at end of file diff --git a/plugin/module/Admin_SystemUniqueIDManager/locale/translation_fr.php.inc b/plugin/module/Admin_SystemUniqueIDManager/locale/translation_fr.php.inc index 58cda7c5..9b96f407 100755 --- a/plugin/module/Admin_SystemUniqueIDManager/locale/translation_fr.php.inc +++ b/plugin/module/Admin_SystemUniqueIDManager/locale/translation_fr.php.inc @@ -1,16 +1,15 @@ - * CaMykS Version : 1.0b - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Creation Date : Jan 2015 - * Last Modif Date : Jan 2015 - * - * Admin_SystemUniqueIDManager french dictionnary -*/ +/** + * @brief Admin_SystemUniqueIDManager Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jan 2015 + * @date Modification: Jan 2021 + * @copyright 2015 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_systemuniqueidmanager_title'] = 'ID Uniques'; $this->trads['mod_admin_systemuniqueidmanager_desc'] = 'Gestion des ID Uniques'; diff --git a/plugin/module/Admin_ThemeChecker/Admin_ThemeChecker.php.inc b/plugin/module/Admin_ThemeChecker/Admin_ThemeChecker.php.inc index 3cfe6b34..0cf4c7f8 100755 --- a/plugin/module/Admin_ThemeChecker/Admin_ThemeChecker.php.inc +++ b/plugin/module/Admin_ThemeChecker/Admin_ThemeChecker.php.inc @@ -1,226 +1,261 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Create Date : Jul 2007 - * Last Modif Date : Jul 2007 - * - * Admin_ThemeChecker module - */ - -class Admin_ThemeChecker extends Module { - /* - * constructor - * @param string $path_type - */ - function Admin_ThemeChecker ( $path_type ) { - parent::Module('Admin_ThemeChecker', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'devel'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Development'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - } - - /* overwrite Module methods */ - - /* - * set module rights - * @return void - * @access private - */ - function get_rights ( ) { - global $camyks; - $this->rights[0] = array( 'name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> false); - } - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - /* check read rights */ - if ( $this->check_right(0) === false ) { - return $this->init_admin_accessDenied(); - } - - /* get mode */ - $this->mode = ( isset($_REQUEST['mode'])?$_REQUEST['mode']:'list'); - switch ( $this->mode ) { - case 'checker' : - $this->init_admin_checker(); - break; - case 'list' : - default : - $this->init_admin_list(); - break; - } - /* generic init */ - parent::init_admin(); - } - - /* - * display module object in admin mode - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* specific admin mode methods */ - - /* - * init module object in admin/checker mode - * @return void - * @access private - */ - function init_admin_checker () { - global $camyks, $global_theme_picts_items; - $view = isset ($_REQUEST['view'])?$_REQUEST['view']:''; - if ( isset($camyks->themes[$view]) ) { - $this->seltheme = &$camyks->themes[$view]; - } else { - return $this->init_admin_list(); - } - - /* list objects to check */ - $files = array('style.css', 'parts.php.inc', 'parts.css', 'editor.css'); - $parts = array('bar'=>array('barLeft', 'barRight', 'barButton', 'barItem'), - 'box'=>array('boxHeader', 'boxTitleBar', 'boxTabsBarHeader','boxTab', 'boxTabSelected', 'boxTabCSSStandart', 'boxTabCSSSelected', 'boxTabCSSRollover', 'boxTabsBarFooter', 'boxButtonsBarHeader', 'boxButtonWithLink', 'boxButtonWithoutLink', 'boxButtonsBarFooter', 'boxContent1Header', 'boxContent1Footer', 'boxContent2Header', 'boxContent2Footer', 'boxFooter'), - 'button'=>array('button'), - 'layeredmenu'=>array('layeredMenuHeader', 'layeredMenuSeparator', 'layeredMenuNoLinkItem', 'layeredMenuLinkItem', 'layeredMenuFooter')); - - /* data & file check */ - $this->infos = array('name'=>$this->seltheme->name, - 'title'=>$this->seltheme->title, - 'version'=>$this->seltheme->version, - 'author'=>$this->seltheme->author_name); - - $this->files = array(); - foreach ( $files as $f ) { - $this->files[] = array('name'=>$f, - 'exists'=>file_exists( $this->seltheme->plugin_path.'/'.$f )); - } - - /* check parts item */ - $this->seltheme->get_parts(); - $this->parts = array(); - foreach ( $parts as $n => $part ) { - $this->parts[$n] = array(); - $this->eparts[$n] = true; - foreach ( $part as $item ) { - $p = isset ( $this->seltheme->parts[$item] ); - $this->parts[$n][$item] = $p; - $this->eparts[$n] = ($this->eparts[$n] and $p); - } - } - - /* check picts images */ - $this->picts = array(); - $this->maxpos = 0; - foreach ( $global_theme_picts_items as $size => $list ) { - $this->picts[$size] = array(); - $this->maxpos = max ( $this->maxpos, count($list['positions'])); - foreach ( $list['items'] as $img ) { - $this->picts[$size][$img] = array(); - foreach ( $list['positions'] as $pos ) - $this->picts[$size][$img][$pos] = file_exists( $this->seltheme->plugin_path.'/img/picts/'.$size.'_'.$img.'_'.$pos.'.gif'); - } - } - - /* demo */ - $this->add_JSScript('demo_tabObject = new CTab();'); - $this->add_JSScript('demo_tabObject.init("demotab1", "' - .$this->seltheme->parts['boxTabCSSStandart'].'", "' - .$this->seltheme->parts['boxTabCSSSelected'].'", "' - .$this->seltheme->parts['boxTabCSSRollover'].'");'); - $this->demo_tabs = array(array('name'=>'demotab1', - 'title'=>$this->get_translation('demo_tab', 1)), - array('name'=>'demotab2', - 'title'=>$this->get_translation('demo_tab', 2))); - - $this->demo_buttons = array(array('title'=>$this->get_translation('demo_button', 1), - 'link'=>'javascript:void(0);'), - array('title'=>$this->get_translation('demo_button', 2), - 'link'=>'javascript:void(0);')); - - $this->demo_layeredmenu = array(array('title' => $this->get_translation('demo_layeredmenu_line'), - 'url' => 'javascript:void(0);', - 'icon'=> ''), - array('title' => $this->get_translation('demo_layeredmenu_nolink'), - 'url' => '', - 'icon'=> ''), - array('title' => $this->get_translation('demo_layeredmenu_noicon'), - 'url' => 'javascript:void(0);', - 'icon'=> ''), - array('title' => '----', - 'url' => '' ), - array('title' => $this->get_translation('demo_layeredmenu_line'), - 'url' => 'javascript:void(0);', - 'icon'=> '')); - - $this->add_JSScript('var demomenu = new CMenu("demomenu", null, "demomenuButton", "bottom");'); - $this->add_JSScript('globalCMenu.registerMenu( demomenu );'); - - - /* load tab engine */ - $openTab = isset( $_REQUEST['openTab']) ? $_REQUEST['openTab']:''; - $this->tabObject = 'admin_themechecker_tabObject'; - $this->add_JSEngineFile('object/ctab.js'); - $this->add_JSScript($this->tabObject.' = new CTab();'); - $this->add_JSScript($this->tabObject.'.init("properties", "' - .$camyks->theme->parts['boxTabCSSStandart'].'", "' - .$camyks->theme->parts['boxTabCSSSelected'].'", "' - .$camyks->theme->parts['boxTabCSSRollover'].'");'); - if ( $openTab != '' and $openTab != 'properties' ) { - $this->add_JSLoadScript($this->tabObject.'.mouseclick(\''.$openTab.'\');'); - } - - - $this->tabs = array(array('name'=>'properties', - 'title'=>$this->get_translation('tabproperties')), - array('name'=>'items', - 'title'=>$this->get_translation('tabitems')), - array('name'=>'picts', - 'title'=>$this->get_translation('tabpicts')), - array('name'=>'demo', - 'title'=>$this->get_translation('tabdemo'))); - - $this->buttons = array(array('title'=>$camyks->get_translation('back'), - 'link'=>$camyks->get_adminLink($this->name))); - - /* update layout */ - $this->selected_layout = 'admin_checker.html.inc'; - } - - /* - * init module object in admin/list mode - * @return void - * @access private - */ - function init_admin_list () { - global $camyks; - - /* set buttons */ - $this->buttons = array(array('title'=>$camyks->get_translation('back'), - 'link'=>$camyks->get_adminLink())); - - /* update layout */ - $this->selected_layout = 'admin_list.html.inc'; - } -} -?> \ No newline at end of file + Check parts managed by themes. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jul 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_ThemeChecker class. + */ +final class Admin_ThemeChecker extends Module { + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_ThemeChecker', $path_type); + + /* Override Plugin variables */ + $this->version = '1.0'; + $this->plugin_package = 'Development'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'devel'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + } + + /* Override Module methods */ + + /** + * Define module permissions. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' =>'read', + 'title' => $camyks->get_translation('read'), + 'default' => false, + ); + } + + /** + * Initialise module object in admin mode + * @return void + */ + public function init_admin() { + /* Check read permission */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Load action to execute */ + $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'list'; + switch ($this->mode) { + case 'checker' : + $this->init_admin_checker(); + break; + case 'list' : + default : + $this->init_admin_list(); + break; + } + + /* Perform generic initialisation */ + parent::init_admin(); + } + + /* specific admin mode methods */ + + /** + * Initialise module object in admin/checker mode. + * @return void + */ + private function init_admin_checker() { + global $camyks, $global_theme_picts_items; + + $view = isset ($_REQUEST['view']) ? $_REQUEST['view'] : ''; + if (isset($camyks->themes[$view])) { + $this->seltheme = $camyks->get_theme($view); + } else { + return $this->init_admin_list(); + } + + /* list objects to check */ + $files = array('style.css', 'parts.php.inc', 'parts.css', 'editor.css'); + $parts = array( + 'bar' => array('barLeft', 'barRight', 'barButton', 'barItem'), + 'box' => array('boxHeader', 'boxTitleBar', 'boxTabsBarHeader','boxTab', 'boxTabSelected', 'boxTabCSSStandart', 'boxTabCSSSelected', 'boxTabCSSRollover', 'boxTabsBarFooter', 'boxButtonsBarHeader', 'boxButtonWithLink', 'boxButtonWithoutLink', 'boxButtonsBarFooter', 'boxContent1Header', 'boxContent1Footer', 'boxContent2Header', 'boxContent2Footer', 'boxFooter'), + 'button' => array('button'), + 'layeredmenu' => array('layeredMenuHeader', 'layeredMenuSeparator', 'layeredMenuNoLinkItem', 'layeredMenuLinkItem', 'layeredMenuFooter'), + ); + + /* data & file check */ + $this->infos = array( + 'name' => $this->seltheme->name, + 'title' => $this->seltheme->title, + 'version' => $this->seltheme->version, + 'author' => $this->seltheme->author_name, + ); + + $this->files = array(); + foreach ($files as $f) { + $this->files[] = array( + 'name' => $f, + 'exists' => (file_exists($this->seltheme->plugin_path.'/'.$f) or file_exists($this->seltheme->plugin_path.'/css/'.$f)), + ); + } + + /* check parts item */ + $this->seltheme->get_parts(); + $this->parts = array(); + foreach ($parts as $n => $part) { + $this->parts[$n] = array(); + $this->eparts[$n] = true; + foreach ($part as $item) { + $p = isset ($this->seltheme->parts[$item]); + $this->parts[$n][$item] = $p; + $this->eparts[$n] = ($this->eparts[$n] and $p); + } + } + + /* check picts images */ + $this->picts = array(); + $this->maxpos = 0; + foreach ($global_theme_picts_items as $size => $list) { + $this->picts[$size] = array(); + $this->maxpos = max ($this->maxpos, count($list['positions'])); + foreach ($list['items'] as $img) { + $this->picts[$size][$img] = array(); + foreach ($list['positions'] as $pos) + $this->picts[$size][$img][$pos] = file_exists($this->seltheme->plugin_path.'/img/picts/'.$size.'_'.$img.'_'.$pos.'.gif'); + } + } + + /* Build demo elements */ + $this->add_JSScript('demo_tabObject = new CTab();'); + $this->add_JSScript('demo_tabObject.init("demotab1", "'.(isset($this->seltheme->parts['boxTabCSSStandart']) ? $this->seltheme->parts['boxTabCSSStandart'] : '').'", "'.(isset($this->seltheme->parts['boxTabCSSSelected']) ? $this->seltheme->parts['boxTabCSSSelected'] : '').'", "'.(isset($this->seltheme->parts['boxTabCSSRollover']) ? $this->seltheme->parts['boxTabCSSRollover'] : '').'");'); + $this->demo_tabs = array( + array( + 'name' => 'demotab1', + 'title' => $this->get_translation('demo_tab', 1), + ), + array( + 'name' => 'demotab2', + 'title' => $this->get_translation('demo_tab', 2), + ), + ); + + $this->demo_buttons = array( + array( + 'title' => $this->get_translation('demo_button', 1), + 'link' => 'javascript:void(0);', + ), + array( + 'title' => $this->get_translation('demo_button', 2), + 'link' => 'javascript:void(0);' + ), + ); + + $this->demo_layeredmenu = array( + array( + 'title' => $this->get_translation('demo_layeredmenu_line'), + 'url' => 'javascript:void(0);', + 'icon' => $this->theme->get_pictURL('edit', 12, 'std'), + ), + array( + 'title' => $this->get_translation('demo_layeredmenu_nolink'), + 'url' => '', + 'icon' => $this->theme->get_pictURL('cross', 12, 'std'), + ), + array( + 'title' => $this->get_translation('demo_layeredmenu_noicon'), + 'url' => 'javascript:void(0);', + 'icon' => '', + ), + array( + 'title' => '----', + 'url' => '', + ), + array( + 'title' => $this->get_translation('demo_layeredmenu_line'), + 'url' => 'javascript:void(0);', + 'icon' => $this->theme->get_pictURL('valid', 12, 'std'), + ), + ); + $this->add_JSScript('var demomenu = new CMenu("demomenu", null, "demomenuButton", "bottom");'); + $this->add_JSScript('globalCMenu.registerMenu(demomenu);'); + + /* Load tab engine */ + $openTab = isset($_REQUEST['openTab']) ? $_REQUEST['openTab'] : ''; + $this->tabObject = 'admin_themechecker_tabObject'; + $this->add_JSEngineFile('object/ctab.js'); + $this->add_JSScript($this->tabObject.' = new CTab();'); + $this->add_JSScript($this->tabObject.'.init("properties", "'.$camyks->theme->parts['boxTabCSSStandart'].'", "'.$camyks->theme->parts['boxTabCSSSelected'].'", "'.$camyks->theme->parts['boxTabCSSRollover'].'");'); + if ($openTab != '' and $openTab != 'properties') + $this->add_JSLoadScript($this->tabObject.'.mouseclick(\''.$openTab.'\');'); + + $this->tabs = array( + array( + 'name' => 'properties', + 'title' => $camyks->get_translation('properties'), + ), + array( + 'name' => 'items', + 'title' => $this->get_translation('tabitems'), + ), + array( + 'name' => 'picts', + 'title' => $this->get_translation('tabpicts'), + ), + array( + 'name' => 'demo', + 'title' => $this->get_translation('tabdemo'), + ), + ); + + /* Build interface buttons */ + $this->buttons = array( + array( + 'title' => $camyks->get_translation('back'), + 'link' => $this->get_adminLink() + ), + ); + + /* update layout */ + $this->set_selectedLayout('admin_checker.html.inc'); + } + + /** + * Initialise module object in admin/list mode + * @return void + */ + private function init_admin_list() { + global $camyks; + + /* Build interface buttons */ + $this->buttons = array( + array( + 'title' => $camyks->get_translation('back'), + 'link' => $camyks->get_adminLink(), + ), + ); + + /* Update layout */ + $this->set_selectedLayout('admin_list.html.inc'); + } +} +?> diff --git a/plugin/module/Admin_ThemeChecker/html/admin_checker.html.inc b/plugin/module/Admin_ThemeChecker/html/admin_checker.html.inc index be3bc350..d592b04f 100755 --- a/plugin/module/Admin_ThemeChecker/html/admin_checker.html.inc +++ b/plugin/module/Admin_ThemeChecker/html/admin_checker.html.inc @@ -1,266 +1,262 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Jul 2007 - * Last Modif Date : Jul 2007 - * - * Admin_ThemeChecker Module Layout : checker action -*/ -global $camyks; -?> -theme->get_boxHeader('width:600px; margin:0 auto;');?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxTabsBar($this->tabs, - $this->tabObject.'.mouseclick', - $this->tabObject.'.mouseover', - $this->tabObject.'.mouseout', - 'properties');?> -theme->get_boxContent2Header();?> -
- - - - - - - infos as $name => $value ) : ?> - - - - - - - - - - - - - - files as $file ) : ?> - - - - - - - - -
- get_translation('check_informations')?> : -
- get_translation($name)?> : - - -
- get_translation('check_content')?> : -
- : - - - get_translation('present')?> - - - get_translation('missing')?> - - -
-
- - - - - - - - theme->get_boxContent2Footer();?> - theme->get_boxButtonsBar( $this->buttons );?> - theme->get_boxFooter();?> - \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Jul 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($this->tabs, $this->tabObject.'.mouseclick', $this->tabObject.'.mouseover', $this->tabObject.'.mouseout', 'properties'); ?> +theme->get_boxContent2Header(); ?> +
+ + + + + + + infos as $name => $value) : ?> + + + + + + + + + + + + + + + + + files as $file) : ?> + + + + + + +
+ get_translation('check_informations').$camyks->get_translation('formitem_separator'); ?> +
+ get_translation($name).$camyks->get_translation('formitem_separator'); ?> + + +
+   +
+ get_translation('check_content').$camyks->get_translation('formitem_separator'); ?> +
+ get_translation('formitem_separator'); ?> + + + get_translation('present'); ?> + + + get_translation('missing'); ?> + + +
+
+ + + + + + + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_ThemeChecker/html/admin_list.html.inc b/plugin/module/Admin_ThemeChecker/html/admin_list.html.inc index 28d06f24..6b3d9439 100755 --- a/plugin/module/Admin_ThemeChecker/html/admin_list.html.inc +++ b/plugin/module/Admin_ThemeChecker/html/admin_list.html.inc @@ -1,37 +1,36 @@ - - * Camyks Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Jul 2007 - * Last Modif Date : Jul 2007 - * - * Admin_ThemeChecker Module Layout : list action - */ -global $camyks; -?> -theme->get_boxHeader('width:500px; margin:0 auto;');?> -theme->get_boxTitleBar( $this->title );?> -theme->get_boxContent1Header();?> -
- - -themes as $v ) :?> - - - - - -
- -title?> - -
-
-theme->get_boxContent1Footer();?> -theme->get_boxButtonsBar( $this->buttons );?> -theme->get_boxFooter();?> - + + * @version 1.0.1 + * @date Creation: Jul 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxContent1Header(); ?> +
+ + + themes as $v) :?> + + + + + +
+ + title; ?> + +
+
+theme->get_boxContent1Footer(); ?> +theme->get_boxButtonsBar($this->buttons); ?> +theme->get_boxFooter(); ?> + diff --git a/plugin/module/Admin_ThemeChecker/locale/translation_fr.php.inc b/plugin/module/Admin_ThemeChecker/locale/translation_fr.php.inc index 323584f7..02d65405 100755 --- a/plugin/module/Admin_ThemeChecker/locale/translation_fr.php.inc +++ b/plugin/module/Admin_ThemeChecker/locale/translation_fr.php.inc @@ -1,21 +1,19 @@ - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Create Date : Jul 2007 - * Last Modif Date : Jul 2007 - * - * Admin_ThemeChecker french dictionnary +/** + * @brief Admin_ThemeChecker Input french dictionnary + * @details Plugin / Input Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Jul 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ $this->trads['mod_admin_themechecker_title'] = 'Vérificateur de thème'; $this->trads['mod_admin_themechecker_desc'] = 'Permet de vérifier les thèmes'; /* tabs titles */ -$this->trads['mod_admin_themechecker_tabproperties'] = 'Propriétés'; $this->trads['mod_admin_themechecker_tabitems'] = 'Eléments graphiques'; $this->trads['mod_admin_themechecker_tabpicts'] = 'Pictos'; $this->trads['mod_admin_themechecker_tabdemo'] = 'Exemples'; diff --git a/plugin/module/Admin_ToDoList/Admin_ToDoList.php.inc b/plugin/module/Admin_ToDoList/Admin_ToDoList.php.inc index b5878836..03d092c8 100755 --- a/plugin/module/Admin_ToDoList/Admin_ToDoList.php.inc +++ b/plugin/module/Admin_ToDoList/Admin_ToDoList.php.inc @@ -1,351 +1,315 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Engine - * Create Date : Apr 2007 - * Last Modif Date : May 2008 - * History : - * * 07-04-xx : Initial files - * * 08-05-28 : Disable admin menu for data I/O modes - * - * Admin_ToDoList Module - * Allow admin user to share thing to be done and comment - */ - -class Admin_ToDoList extends Module { - /* variables */ - var $item; - var $comment; - var $todolist; - - /* - * constructor - * @param string $path_type - */ - function Admin_ToDoList ( $path_type ) { - parent::Module('Admin_ToDoList', $path_type); - /* set module type */ - $this->type = 'admin'; - $this->admin_type = 'helpers'; - /* set plugin version */ - $this->version = '1.0'; - /* set plugin package */ - $this->plugin_package = 'Default'; - /* set plugin author */ - $this->author_name = 'CaMykS Team'; - $this->author_mail = 'camyks.contact@gmail.com'; - $this->author_group = 'camyks.net'; - - /* load plugin libraries */ - $this->libs[] = 'Admin_ToDoItem.php.inc'; - $this->libs[] = 'Admin_ToDoComment.php.inc'; - $this->get_PHPLibs(); - - /* initialise plugin libraries */ - $this->item = new Admin_ToDoItem( 0, $this ); - $this->comment = new Admin_ToDoComment( 0, $this ); - } - - /* overwrite Module methods */ - - /* - * install module - * @return boolean success - * @access private - */ - function install ( ) { - if ( $this->item->install( ) and $this->comment->install( ) ) { - return parent::install(); - } - return false; - } - - /* - * uninstall module - * @return boolean success - * @access private - */ - function uninstall ( ) { - parent::uninstall(); - /* TO DO */ - } - - /* - * check module installation - * @return boolean result - * @access private - */ - function is_installed ( ) { - return $this->comment->is_installed(); - } - - /* - * get module rights - * @return void - * @access private - */ - function get_rights ( ) { - global $camyks; - $this->rights[0] = array( 'name'=>'read', - 'title'=> $camyks->get_translation('read'), - 'default'=> true); - $this->rights[1] = array( 'name'=>'write', - 'title'=> $camyks->get_translation('write'), - 'default'=> true); - } - - /* - * update description in control panel - * @return void - * @access private - */ - function get_adminControlPanelAction ( ) { - global $camyks; - $n = $this->item->get_objectCount('to_user="" or to_user="'. - $camyks->adminUser->login. - '" or from_user="'. - $camyks->adminUser->login.'"'); - $camyks->trads['mod_admin_todolist_desc'] = vsprintf($camyks->trads['mod_admin_todolist_desc_'], $n ); - } - - - /* - * init module object in admin mode - * @return void - * @access private - */ - function init_admin () { - global $camyks; - /* check read rights */ - if ( $this->check_right(0) === false ) { - return $this->init_admin_accessDenied(); - } - - /* get mode */ - $this->mode = ( isset ( $_REQUEST['mode'] ) ? $_REQUEST['mode'] : 'list' ); - - /* get action to execute case of mode */ - switch ( $this->mode ) { - case 'view': - /* mode == view */ - $this->init_admin_view(); - break; - case 'edit': - /* mode == edit */ - $this->init_admin_edit(); - break; - case 'save': - /* mode == save */ - $this->init_admin_save(); - break; - case 'savecomment': - /* mode == savecomment */ - $this->init_admin_savecomment(); - break; - case 'delete': - /* mode == delete */ - $this->init_admin_delete(); - break; - case 'list': - default: - /* mode == list */ - $this->init_admin_list(); - break; - } - parent::init_admin(); - } - - /* - * init module object in display mode - * @return void - * @access private - */ - function display_admin () { - parent::display_admin(); - } - - /* specific admin mode methods */ - - /* - * init module object in admin/list mode - * @return void - * @access private - */ - function init_admin_list ( ) { - global $camyks; - /* get to-do-items list */ - $this->todolist = $this->item->get_objectList(false, - 'to_user="" or to_user="'. - $camyks->adminUser->login. - '" or from_user="'. - $camyks->adminUser->login.'"'); - /* get tabs engine */ - $this->get_admin_tabs ( ); - } - - /* - * init module object in admin/edit mode - * @return void - * @access private - */ - function init_admin_edit ( ) { - global $camyks; - if ( $this->check_right ( 1 )===false ) { - return $this->init_admin_actionNotAllowed(); - } - - /* get user profile to modify */ - if ( $this->item->id == -1 ) { - $this->item->id = isset ( $_REQUEST['todo'] ) ? $_REQUEST['todo'] : 0; - $this->item->get(); - } - - /* get form */ - $this->form = new HTMLForm( 'admintodolist', - $camyks->get_adminLink($this->name), - 'POST'); - $this->form->add_hidden('mode', 'save' ); - $this->form->add_hidden('todo', $this->item->id ); - $this->form->add_hidden('from_user', $this->item->vars['from_user'] ); - $this->form->add_hidden('creation_date', $this->item->vars['creation_date'] ); - - /* get list( and tabs engine ) */ - $this->init_admin_list(); - - /* select tabs */ - $this->add_JSLoadScript('admin_todolist_tabObject.mouseclick("edit");'); - } - - /* - * init module object in admin/view mode - * @return void - * @access private - */ - function init_admin_view ( ) { - global $camyks; - /* get user profile to view */ - $this->item->id = isset ( $_REQUEST['todo'] ) ? $_REQUEST['todo'] : 0; - $this->item->get(); - - /* get comment form */ - $this->form = new HTMLForm( 'admintodolist', - $camyks->get_adminLink($this->name), - 'POST'); - $this->form->add_hidden('mode', 'savecomment' ); - $this->form->add_hidden('todo', $this->item->id ); - $this->form->add_hidden('from_user', $camyks->adminUser->login ); - $this->form->add_hidden('creation_date', -1 ); - - /* select tabs */ - $this->add_JSLoadScript('admin_todolist_tabObject.mouseclick("view");'); - - /* get list( and tabs engine ) */ - $this->init_admin_list(); - } - - /* - * init module object in admin/delete mode - * @return void - * @access private - */ - function init_admin_delete ( ) { - global $camyks; - - /* check rights */ - if ( $this->check_right(1)=== false ) { - return $this->init_admin_actionNotAllowed(); - } - - /* disable admin menus */ - $this->disable_adminEngineMenus(); - - /* get item */ - $this->item->id = isset ( $_REQUEST['todo'] ) ? $_REQUEST['todo'] : 0; - if ( $this->item->delete_fromDatabase( ) ) { - $this->text = $camyks->get_translation('deletedone'); - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect( 4, $camyks->get_adminLink( $this->name, array('mode'=>'list'))); - } else { - $this->init_admin_edit(); - } - } - - /* - * init module object in admin/save mode - * @return void - * @access private - */ - function init_admin_save ( ) { - global $camyks; - /* check rights */ - if ( $this->check_right(1)===false ) { - return $this->init_admin_actionNotAllowed(); - } - - /* disable admin menus */ - $this->disable_adminEngineMenus(); - - /* get item */ - $this->item->id = isset ( $_REQUEST['todo'] ) ? $_REQUEST['todo'] : 0; - $this->item->get_fromHeader( ); - if ( $this->item->save( ) ) { - $this->text = $camyks->get_translation('savedone'); - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect( 4, $camyks->get_adminLink( $this->name, array('mode'=>'view', - 'todo'=> $this->item->id))); - } else { - $this->init_admin_edit(); - } - } - - /* - * init module object in admin/savecomment mode - * @return void - * @access private - */ - function init_admin_savecomment ( ) { - global $camyks; - - /* disable admin menus */ - $this->disable_adminEngineMenus(); - - /* get comment item */ - $this->comment->id = 0; - $this->comment->get_fromHeader( ); - if ( $this->comment->save( ) ) { - $this->text = $this->get_translation('commentsaved'); - } else { - $this->text = $this->get_translation('commentnotsaved'); - } - $this->selected_layout = 'admin_message.html.inc'; - $this->selected_layout_location = 'camyks'; - $this->set_redirect( 4, $camyks->get_adminLink( $this->name, - array('mode'=>'view', - 'todo'=> $this->comment->_libItems['todo']->value))); - } - - /* specific tool methods */ - - /* - * get javascript for tabs - * @return void - * @access private - */ - function get_admin_tabs ( ) { - global $camyks; - $this->add_JSEngineFile('object/ctab.js'); - $this->add_JSScript('admin_todolist_tabObject = new CTab();'); - $this->add_JSScript('admin_todolist_tabObject.init("general", "' - .$camyks->theme->parts['boxTabCSSStandart'].'","' - .$camyks->theme->parts['boxTabCSSSelected'].'","' - .$camyks->theme->parts['boxTabCSSRollover'].'");'); - } -} - -?> \ No newline at end of file + Manages shared to do list for admin users. + * @details Plugin, Module Engine + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Apr 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_ToDoList class. + */ +final class Admin_ToDoList extends Module { + /** + * var Object $item + * @brief Task object. + */ + public $item; + + /** + * var Object $comment + * @brief Comment object. + */ + public $comment; + + /** + * var array $todolist + * @brief Task list. + */ + public $todolist = null; + + /** + * Class constructor. + * @param string $path_type + * @return void + */ + public function __construct($path_type) { + parent::__construct('Admin_ToDoList', $path_type); + + /* Override Plugins variables */ + $this->version = '1.0'; + $this->plugin_package = 'Default'; + + /* Override Module variables */ + $this->type = 'admin'; + $this->admin_type = 'helpers'; + + /* Define plugin author */ + $this->author_name = 'CaMykS Team'; + $this->author_mail = 'camyks.contact@gmail.com'; + $this->author_group = 'camyks.net'; + + /* Load plugin libraries */ + $this->load_library('Admin_ToDoItem'); + $this->load_library('Admin_ToDoComment'); + + /* initialise plugin libraries */ + $this->item = new Admin_ToDoItem(0, $this); + $this->comment = new Admin_ToDoComment(0, $this); + } + + /* Override Module methods */ + + /** + * Install module. + * @return boolean success + */ + public function install() { + return $this->item->install() and $this->comment->install() + and parent::install(); + } + + /** + * Check module installation. + * @return boolean result + */ + public function is_installed() { + return $this->comment->is_installed(); + } + + /** + * Define module permissions. + * @return void + */ + public function get_rights() { + global $camyks; + $this->rights[0] = array( + 'name' => 'read', + 'title' => $camyks->get_translation('read'), + 'default' => true, + ); + $this->rights[1] = array( + 'name' => 'write', + 'title' => $camyks->get_translation('write'), + 'default' => true, + ); + } + + /** + * Update description in control panel. + * @return void + */ + public function get_adminControlPanelAction() { + global $camyks; + $n = $this->item->get_objectCount('to_user="" or to_user="'.$camyks->adminUser->login.'" or from_user="'.$camyks->adminUser->login.'"'); + $camyks->trads['mod_admin_todolist_desc'] = $this->get_translation('desc_', $n); + } + + + /** + * Initialise module object in admin mode. + * @return void + */ + public function init_admin() { + global $camyks; + + /* Check read permission */ + if ($this->check_right(0) === false) + return $this->init_admin_accessDenied(); + + /* Load action to execute */ + $this->mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'list'; + + /* Execute action */ + switch ($this->mode) { + case 'view': + /* mode == view */ + $this->init_admin_view(); + break; + case 'edit': + /* mode == edit */ + $this->init_admin_edit(); + break; + case 'save': + /* mode == save */ + $this->init_admin_save(); + break; + case 'savecomment': + /* mode == savecomment */ + $this->init_admin_savecomment(); + break; + case 'delete': + /* mode == delete */ + $this->init_admin_delete(); + break; + case 'list': + default: + /* mode == list */ + $this->init_admin_list(); + break; + } + parent::init_admin(); + } + + /* specific admin mode methods */ + + /** + * Initialise module object in admin/list mode. + * @return void + */ + public function init_admin_list() { + global $camyks; + /* get to-do-items list */ + $this->todolist = $this->item->get_objectList(false, 'to_user="" or to_user="'.$camyks->adminUser->login.'" or from_user="'.$camyks->adminUser->login.'"'); + /* get tabs engine */ + $this->get_admin_tabs(); + } + + /** + * Initialise module object in admin/edit mode. + * @return void + */ + private function init_admin_edit() { + global $camyks; + + if ($this->check_right(1)===false) { + return $this->init_admin_actionNotAllowed(); + } + + /* get user profile to modify */ + if ($this->item->id == -1) { + $this->item->id = isset($_REQUEST['todo']) ? $_REQUEST['todo'] : 0; + $this->item->get(); + } + + /* get form */ + $this->form = new HTMLForm('admintodolist', $this->get_adminLink(), 'POST'); + $this->form->add_hidden('mode', 'save'); + $this->form->add_hidden('todo', $this->item->id); + $this->form->add_hidden('from_user', $this->item->vars['from_user']); + $this->form->add_hidden('creation_date', $this->item->vars['creation_date']); + + /* get list(and tabs engine) */ + $this->init_admin_list(); + + /* select tabs */ + $this->add_JSLoadScript('admin_todolist_tabObject.mouseclick("edit");'); + } + + /** + * Initialise module object in admin/view mode. + * @return void + */ + private function init_admin_view() { + global $camyks; + /* get user profile to view */ + $this->item->id = isset($_REQUEST['todo']) ? $_REQUEST['todo'] : 0; + $this->item->get(); + + /* get comment form */ + $this->form = new HTMLForm('admintodolist', $this->get_adminLink(), 'POST'); + $this->form->add_hidden('mode', 'savecomment'); + $this->form->add_hidden('todo', $this->item->id); + $this->form->add_hidden('from_user', $camyks->adminUser->login); + $this->form->add_hidden('creation_date', -1); + + /* select tabs */ + $this->add_JSLoadScript('admin_todolist_tabObject.mouseclick("view");'); + + /* get list(and tabs engine) */ + $this->init_admin_list(); + } + + /** + * Initialise module object in admin/delete mode. + * @return void + */ + private function init_admin_delete() { + global $camyks; + + /* Check rights */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* disable admin menus */ + $this->disable_adminEngineMenus(); + + /* get item */ + $this->item->id = isset($_REQUEST['todo']) ? (int)$_REQUEST['todo'] : 0; + if ($this->item->delete_fromDatabase()) { + $this->text = $camyks->get_translation('deletedone'); + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('mode'=>'list'))); + } else { + $this->init_admin_edit(); + } + } + + /** + * Initialise module object in admin/save mode. + * @return void + */ + private function init_admin_save() { + global $camyks; + + /* Check rights */ + if ($this->check_right(1) === false) + return $this->init_admin_actionNotAllowed(); + + /* disable admin menus */ + $this->disable_adminEngineMenus(); + + /* get item */ + $this->item->id = isset($_REQUEST['todo']) ? (int)$_REQUEST['todo'] : 0; + $this->item->get_fromHeader(); + if ($this->item->save()) { + $this->text = $camyks->get_translation('savedone'); + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('mode'=>'view', 'todo'=> $this->item->id))); + } else { + $this->init_admin_edit(); + } + } + + /** + * Initialise module object in admin/savecomment mode. + * @return void + */ + private function init_admin_savecomment() { + global $camyks; + + /* disable admin menus */ + $this->disable_adminEngineMenus(); + + /* get comment item */ + $this->comment->id = 0; + $this->comment->get_fromHeader(); + if ($this->comment->save()) { + $this->text = $this->get_translation('commentsaved'); + } else { + $this->text = $this->get_translation('commentnotsaved'); + } + $this->set_selectedLayout('admin_message.html.inc', 'camyks'); + $this->set_redirect($this->get_adminLink(array('mode'=>'view', 'todo'=> $this->comment->_libItems['todo']->value))); + } + + /* specific tool methods */ + + /** + * Inserts javascript for tabs. + * @return void + */ + private function get_admin_tabs() { + global $camyks; + $this->add_JSEngineFile('object/ctab.js'); + $this->add_JSScript('admin_todolist_tabObject = new CTab();'); + $this->add_JSScript('admin_todolist_tabObject.init("general", "'.$camyks->theme->parts['boxTabCSSStandart'].'","'.$camyks->theme->parts['boxTabCSSSelected'].'","'.$camyks->theme->parts['boxTabCSSRollover'].'");'); + } +} +?> diff --git a/plugin/module/Admin_ToDoList/html/admin.html.inc b/plugin/module/Admin_ToDoList/html/admin.html.inc index 7f80ffa0..3420626b 100755 --- a/plugin/module/Admin_ToDoList/html/admin.html.inc +++ b/plugin/module/Admin_ToDoList/html/admin.html.inc @@ -1,301 +1,260 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Layout - * Create Date : Apr 2007 - * Last Modif Date : May 2007 - * - * Admin_ToDoList Module Admin Layout - * -*/ -/** - * @cond Exclude - */ -global $camyks; - -/* get imgs url */ -$view = $camyks->theme->get_pictURL('view', 12, 'std'); -$view_ = $camyks->theme->get_pictURL('view', 12, 'ovr'); -$edit = $camyks->theme->get_pictURL('edit', 12, 'std'); -$edit_ = $camyks->theme->get_pictURL('edit', 12, 'ovr'); -$del = $camyks->theme->get_pictURL('cross', 12, 'std'); -$del_ = $camyks->theme->get_pictURL('cross', 12, 'ovr'); -$upd = $camyks->theme->get_pictURL('target', 12, 'std'); -$upd_ = $camyks->theme->get_pictURL('target', 12, 'ovr'); - -/* button list for buttons bar */ -$buttons = array(array('title'=>$camyks->get_translation('back'), - 'link' =>$camyks->get_adminLink())); - -if ( $this->mode == 'edit' ) { - $buttons[] = array('title'=>$this->get_translation('validobject'), - 'link'=>'javascript:document.admintodolist.submit()'); -} - -/* tab list */ -$tabs = array(array('name'=>'general', - 'title'=>$this->get_translation('tablist'))); - -if ( $this->mode == 'edit' and $this->item->id == 0 ) { - $tabs[] = array('name'=>'edit', - 'title'=>$this->get_translation('tabnew')); -} else if ( $this->mode == 'edit' ) { - $tabs[] = array('name'=>'edit', - 'title'=>$this->get_translation('tabedit')); -} else if ( $this->mode == 'view' ) { - $tabs[] = array('name'=>'view', - 'title'=>$this->get_translation('tabview', $this->item->vars['title'])); - $tabs[] = array('name'=>'comments', - 'title'=>$this->get_translation('tabcomments', count($this->item->vars['comments']))); -} - -$jsObject = 'admin_todolist_tabObject'; - -?> -theme->get_boxHeader('width:600px;margin:0 auto;');?> -theme->get_boxTitleBar($this->title);?> -theme->get_boxTabsBar($tabs, - $jsObject.'.mouseclick', - $jsObject.'.mouseover', - $jsObject.'.mouseout', - 'general');?> -theme->get_boxContent2Header();?> -
- - - - - - -check_right ( 1 ) ) : ?> - - - - -check_right ( 1 ) ) : ?> - - - - - - - - - - -todolist as $todo ) : ?> - - - - - -check_right ( 1 ) ) : ?> - - - - - -
- get_translation('name')?> - - get_translation('user')?> - - get_translation('limitdateform')?> - -   - -   -
- -get_translation('new_item')?> - -   - - - - 
- -vars['title'];?> - - - -vars['from_user'];?> - - - -vars['limit_date']==0 ? $this->get_translation('none') : date_displayShortFormat($todo->vars['limit_date']);?> - - - -<?=$this->get_translation('view')?> - - -<?=$this->get_translation('edit')?> - - -<?=$this->get_translation('del')?> -
-
- -mode == 'edit' ) : ?> - - -mode == 'view' ) : ?> - - - - - - -theme->get_boxContent2Footer();?> -theme->get_boxButtonsBar( $buttons );?> -theme->get_boxFooter();?> - \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Apr 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +global $camyks; + +/* get imgs url */ +$view = $camyks->theme->get_pictURL('view', 12, 'std'); +$view_ = $camyks->theme->get_pictURL('view', 12, 'ovr'); +$edit = $camyks->theme->get_pictURL('edit', 12, 'std'); +$edit_ = $camyks->theme->get_pictURL('edit', 12, 'ovr'); +$del = $camyks->theme->get_pictURL('cross', 12, 'std'); +$del_ = $camyks->theme->get_pictURL('cross', 12, 'ovr'); +$upd = $camyks->theme->get_pictURL('target', 12, 'std'); +$upd_ = $camyks->theme->get_pictURL('target', 12, 'ovr'); + +/* button list for buttons bar */ +$buttons = array(array('title'=>$camyks->get_translation('back'), 'link' =>$camyks->get_adminLink())); +if ($this->mode == 'edit') + $buttons[] = array('title'=>$this->get_translation('validobject'), 'link'=>'javascript:document.admintodolist.submit()'); + +/* tab list */ +$tabs = array(array('name'=>'general', 'title'=>$this->get_translation('tablist'))); + +if ($this->mode == 'edit' and $this->item->id == 0) { + $tabs[] = array('name'=>'edit', 'title'=>$this->get_translation('tabnew')); +} else if ($this->mode == 'edit') { + $tabs[] = array('name'=>'edit', 'title'=>$this->get_translation('tabedit')); +} else if ($this->mode == 'view') { + $tabs[] = array('name'=>'view', 'title'=>$this->get_translation('tabview', $this->item->vars['title'])); + $tabs[] = array('name'=>'comments', 'title'=>$this->get_translation('tabcomments', count($this->item->vars['comments']))); +} +$jsObject = 'admin_todolist_tabObject'; + +?> +theme->get_boxHeader(array('class'=>'adminEditorModule')); ?> +theme->get_boxTitleBar($this->title); ?> +theme->get_boxTabsBar($tabs, $jsObject.'.mouseclick', $jsObject.'.mouseover', $jsObject.'.mouseout', 'general'); ?> +theme->get_boxContent2Header(); ?> +
+ + + + + + + check_right(1)) : ?> + + + + + check_right(1)) : ?> + + + + + + + + + + + todolist as $todo) : ?> + + + + + + check_right(1)) : ?> + + + + + + +
+ get_translation('name'); ?> + + get_translation('user'); ?> + + get_translation('limitdateform'); ?> + +   + +   +
+ + get_translation('new_item'); ?> + + +   + +   + + + + + +   +
+ + vars['title']; ?> + + + + vars['from_user']; ?> + + + + vars['limit_date']==0 ? $this->get_translation('none') : date_displayShortFormat($todo->vars['limit_date']); ?> + + + + <?= $this->get_translation('view'); ?> + + + + <?= $this->get_translation('edit'); ?> + + + + <?= $this->get_translation('del'); ?> + +
+
+ +mode == 'edit') : ?> + +mode == 'view') : ?> + + + + +theme->get_boxContent2Footer(); ?> +theme->get_boxButtonsBar($buttons); ?> +theme->get_boxFooter(); ?> diff --git a/plugin/module/Admin_ToDoList/lib/Admin_ToDoComment.php.inc b/plugin/module/Admin_ToDoList/lib/Admin_ToDoComment.php.inc index bd408c9b..71bceaaa 100755 --- a/plugin/module/Admin_ToDoList/lib/Admin_ToDoComment.php.inc +++ b/plugin/module/Admin_ToDoList/lib/Admin_ToDoComment.php.inc @@ -1,46 +1,50 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Lib - * Creation Date : Apr 2007 - * Last Modif Date : May 2007 - * - * Admin_ToDoComment object for Admin_ToDoList Module - */ - -class Admin_ToDoComment extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_ToDoComment ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - /* content */ - $this->add_newItem('todo', 'db', 'int', 'bigint', '', 0); - $this->add_newItem('from_user', 'db', 'text', 'varchar', 32, ''); - $this->add_newItem('creation_date', 'db', 'date', 'bigint', '', time()); - $this->add_newItem('content', 'db', 'etext', 'text', '', ''); - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary methods */ - - /* - * check object data - * @return boolean success - * @access private - */ - function check_data ( ) { - if ( trim($this->_libItems['content']->value) == '' ) { - return false; - } - return true; - } -} -?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Apr 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_ToDoComment class. + */ +final class Admin_ToDoComment extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Content attributes */ + $this->add_newItem('todo', 'db', 'int', 'bigint', '', 0); + $this->add_newItem('from_user', 'db', 'text', 'varchar', 32, ''); + $this->add_newItem('creation_date', 'db', 'date', 'bigint', '', time()); + $this->add_newItem('content', 'db', 'etext', 'text', '', ''); + + /* Generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary methods */ + + /** + * Check object data. + * @return boolean success + */ + public function check_data() { + if (trim($this->_libItems['content']->value) == '') { + return false; + } + return true; + } +} +?> diff --git a/plugin/module/Admin_ToDoList/lib/Admin_ToDoItem.php.inc b/plugin/module/Admin_ToDoList/lib/Admin_ToDoItem.php.inc index 66b8b638..b08e3aee 100755 --- a/plugin/module/Admin_ToDoList/lib/Admin_ToDoItem.php.inc +++ b/plugin/module/Admin_ToDoList/lib/Admin_ToDoItem.php.inc @@ -1,88 +1,91 @@ - - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Lib - * Creation Date : Apr 2007 - * Last Modif Date : Apr 2007 - * - * Admin_ToDoItem object for Admin_ToDoList Module -*/ - -class Admin_ToDoItem extends ModuleLibrary { - /* - * constructor - * @param integer $id - * @param Module $module - */ - function Admin_ToDoItem ( $id, &$module ) { - parent::ModuleLibrary ( $id, $module ); - /* content */ - $this->add_newItem('from_user', 'db', 'text', 'varchar', 32, ''); - $this->add_newItem('to_user', 'db', 'text', 'varchar', 32, ''); - $this->add_newItem('creation_date', 'db', 'date', 'bigint', '', time()); - $this->add_newItem('limit_date', 'db', 'date', 'bigint', '', 0); - $this->add_newItem('title', 'db', 'text', 'varchar', 64, ''); - $this->add_newItem('content', 'db', 'text', 'text', '', ''); - $this->add_newItem('sticked', 'db', 'text', 'text', '', ''); - $this->add_newItem('closed', 'db', 'int', 'tinyint', '', 0); - /* temporary content */ - $this->add_newItem('users', 'temp', 'array', '', '', array()); - $this->add_newItem('comments', 'temp', 'array', '', '', array()); - /* generic initialisation */ - $this->init_library(); - } - - /* overwrite ModuleLibrary methods */ - - /* - * get object - * @return boolean success - * @access private - */ - function get ($language=true) { - global $camyks; - /* update from user default value */ - $this->_libItems['from_user']->default = $camyks->adminUser->login; - /* generic get */ - parent::get(); - /* specific get */ - $this->get_specificValues(); - $this->get_fromItems(); - return true; - } - - /* - * delete object - * @return boolean success - * @access private - */ - function delete_fromDatabase() { - $c = new Admin_ToDoComment( 0, $this->_libParent ); - if ( $c->delete_selectedItemsFromDatabase( array('todo' => $this->id ) ) ) { - return parent::delete_fromDatabase(); - } - return false; - } - - /* specific tool methods */ - - /* - * get specific values for this object - * @return void - * @access private - */ - function get_specificValues ( ){ - /* get all user list */ - $this->_libItems['users']->value = AdminUser::static_getList(); - if ( $this->id > 0 ) { - /* get comment list */ - $c = new Admin_ToDoComment( 0, $this->_libParent ); - $this->_libItems['comments']->value = $c->get_objectlist ( false, 'todo='.$this->id, -1, -1, 'creation_date', 'desc' ); - } - } -} -?> \ No newline at end of file + + * @version 1.0.1 + * @date Creation: Apr 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Admin_ToDoItem class. + */ +final class Admin_ToDoItem extends ModuleLibrary { + /** + * Class constructor. + * @param integer $id + * @param Module $module + * @return void + */ + public function __construct($id, &$module) { + parent::__construct($id, $module); + + /* Content attributes */ + $this->add_newItem('from_user', 'db', 'text', 'varchar', 32, ''); + $this->add_newItem('to_user', 'db', 'text', 'varchar', 32, ''); + $this->add_newItem('creation_date', 'db', 'date', 'bigint', '', time()); + $this->add_newItem('limit_date', 'db', 'date', 'bigint', '', 0); + $this->add_newItem('title', 'db', 'text', 'varchar', 64, ''); + $this->add_newItem('content', 'db', 'text', 'text', '', ''); + $this->add_newItem('sticked', 'db', 'text', 'text', '', ''); + $this->add_newItem('closed', 'db', 'int', 'tinyint', '', 0); + + /* Temporary attributes */ + $this->add_newItem('users', 'temp', 'array', '', '', array()); + $this->add_newItem('comments', 'temp', 'array', '', '', array()); + + /* Generic initialisation */ + $this->init_library(); + } + + /* Override ModuleLibrary methods */ + + /** + * Load object. + * @return boolean success + */ + public function get($language=true) { + global $camyks; + /* update from user default value */ + $this->_libItems['from_user']->default = $camyks->adminUser->login; + /* generic get */ + parent::get(); + /* specific get */ + $this->get_specificValues(); + $this->get_fromItems(); + return true; + } + + /** + * Delete object. + * @return boolean success + */ + public function delete_fromDatabase() { + $c = new Admin_ToDoComment(0, $this->_libParent); + if ($c->delete_selectedItemsFromDatabase(array('todo' => $this->id))) { + return parent::delete_fromDatabase(); + } + return false; + } + + /* Specific tool methods */ + + /** + * Load specific values for this object. + * @return void + */ + public function get_specificValues() { + /* get all user list */ + $this->_libItems['users']->value = AdminUser::static_getList(); + if ($this->id > 0) { + /* get comment list */ + $c = new Admin_ToDoComment(0, $this->_libParent); + $this->_libItems['comments']->value = $c->get_objectlist(false, 'todo='.$this->id, -1, -1, 'creation_date', 'desc'); + } + } +} +?> diff --git a/plugin/module/Admin_ToDoList/locale/translation_fr.php.inc b/plugin/module/Admin_ToDoList/locale/translation_fr.php.inc index 8214c4fa..3a27e99e 100755 --- a/plugin/module/Admin_ToDoList/locale/translation_fr.php.inc +++ b/plugin/module/Admin_ToDoList/locale/translation_fr.php.inc @@ -1,16 +1,15 @@ - * CaMykS Version : 1.0a - * Object Version : 1.0 - * Object Type : Plugin / Module Dictionnary - * Create Date : Apr 2007 - * Last Modif Date : Apr 2007 - * - * Admin_ToDoList french dictionnary -*/ +/** + * @brief Admin_ToDoList Module french dictionnary + * @details Plugin / Module Dictionnary + * @author CaMykS Team + * @version 1.0.1 + * @date Creation: Apr 2007 + * @date Modification: Jan 2021 + * @copyright 2007 - 2021 CaMykS Team + * @note This program is distributed as is - WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ $this->trads['mod_admin_todolist_title'] = 'Liste To-Do'; $this->trads['mod_admin_todolist_desc'] = 'Conserve les idées.'; $this->trads['mod_admin_todolist_desc_'] = 'Conserve %s idée(s).'; @@ -45,4 +44,4 @@ $this->trads['mod_admin_todolist_commentsaved'] = 'Commentaire ajouté...' $this->trads['mod_admin_todolist_commentnotsaved'] = 'Le commentaire n\'a pas été ajouté.'; $this->trads['mod_admin_todolist_commentfrom'] = 'Commentaire de %s le %s.'; $this->trads['mod_admin_todolist_deleteconfirmation'] = 'Etes vous sur de vouloir effacer cet objet?'; -?> \ No newline at end of file +?> diff --git a/plugin/module/Admin_User/lib/AdminUser.php.inc b/plugin/module/Admin_User/lib/AdminUser.php.inc index c0f7e370..b227f2fb 100755 --- a/plugin/module/Admin_User/lib/AdminUser.php.inc +++ b/plugin/module/Admin_User/lib/AdminUser.php.inc @@ -4,10 +4,10 @@ * @details Plugin / Module Library * @file plugin/module/Admin_User/lib/AdminUser.php.inc * @author CaMykS Team - * @version 1.0.2 + * @version 1.0.2.2 * @date Creation: Sep 2005 - * @date Modification: Aug 2020 - * @copyright 2005 - 2020 CaMykS Team + * @date Modification: Jan 2021 + * @copyright 2005 - 2021 CaMykS Team * @note This program is distributed as is - WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * @remark Permissions are defined as an int constructed like :
@@ -298,7 +298,7 @@ final class AdminUser { $this->login = $_REQUEST[$prefix.'login']; $this->firstname = $_REQUEST[$prefix.'firstname']; $this->lastname = $_REQUEST[$prefix.'lastname']; - $this->email = $_REQUEST[$prefix.'email']; + $this->email = $_REQUEST[$prefix.'email']; $this->address = $_REQUEST[$prefix.'address']; /* get is_new value */ @@ -438,7 +438,7 @@ final class AdminUser { * @param string $login * @return boolean result */ - private function exists_login($login) { + public function exists_login($login) { global $camyks; /* check database connexion and by pass it for check while installing website */