Skip to content

Commit

Permalink
Update bundled modules
Browse files Browse the repository at this point in the history
  • Loading branch information
instantflorian committed May 23, 2020
1 parent 9f49798 commit 6f1a066
Show file tree
Hide file tree
Showing 84 changed files with 2,946 additions and 821 deletions.
122 changes: 61 additions & 61 deletions wbce/modules/addon_monitor/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* WebsiteBaker CMS AdminTool: addonMonitor
*
* This file provides some functions for the addonMonitor Tool.
*
*
*
*
* @platform CMS WebsiteBaker 2.8.x
* @package addonMonitor
* @author Christian M. Stefan (Stefek)
Expand All @@ -13,68 +13,68 @@
*/

// prevent this file from being accessed directly:
if(!defined('WB_PATH')) die("Cannot access this file directly");
if(!defined('WB_PATH')) die("Cannot access this file directly");

if(!function_exists('getModulesArray')){
function getModulesArray(){
global $database;
global $database;
$aAddons['addons'] = array();
$aAddons['count_tools'] = 0;
$aAddons['count_snippets'] = 0;
$aAddons['count_pagemodules'] = 0;
$aAddons['count_wysiwygeditors'] = 0;
$aAddons['default_wysiwyg'] = $database->get_one("SELECT `value` FROM `". TABLE_PREFIX ."settings` WHERE `name` = 'wysiwyg_editor'");
$sQueryAddons = (
"SELECT DISTINCT a . * ,
"SELECT DISTINCT a . * ,
IF( s.module IS NOT NULL , 'Y', 'N' ) AS active
FROM ".TABLE_PREFIX."addons a
LEFT JOIN ".TABLE_PREFIX."sections s
ON a.directory = s.module
FROM ".TABLE_PREFIX."addons a
LEFT JOIN ".TABLE_PREFIX."sections s
ON a.directory = s.module
WHERE `function` LIKE '%page%' OR `function` LIKE '%snippet%' OR `function` LIKE '%tool%' OR `function` LIKE '%wysiwyg%'"
);

if($oAddons = $database->query($sQueryAddons)){
if($oAddons = $database->query($sQueryAddons)){
$sLanguageFileLocation = WB_PATH."/modules/%s/languages/".LANGUAGE.".php";
$mod_name = '';
$module_name = '';
// Loop through addons
while($aRec = $oAddons->fetchRow(MYSQL_ASSOC)){
while($aRec = $oAddons->fetchRow(MYSQLI_ASSOC)){
// grab for page_id's and section_id's if Addon is a PAGE TYPE MODULE
if($aRec['function'] == 'page'){
if($aRec['function'] == 'page'){
++$aAddons['count_pagemodules'];
if($aRec['active'] == 'Y'){
$sQueryActiveSections = ("SELECT `section_id`, `page_id` FROM `".TABLE_PREFIX."sections` WHERE `module` = '".$aRec['directory']."'");
if($oActiveSections = $database->query($sQueryActiveSections)){
while($aSections = $oActiveSections->fetchRow(MYSQL_ASSOC)){
while($aSections = $oActiveSections->fetchRow(MYSQLI_ASSOC)){
$aRec['active_sections'][$aSections['section_id']] = $aSections['page_id'];
}
}
}
}
}
}
if($aRec['function'] == 'tool'){
if($aRec['function'] == 'tool'){
$aAddons['count_tools']++;
$sIconFile = WB_PATH."/modules/".$aRec['directory']."/tool_icon.png";
if(is_readable($sIconFile)){
$aRec['icon'] = "../../modules/".$aRec['directory']."/tool_icon.png";
}else{
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/tool.png";
if(is_readable($sIconFile)){
$aRec['icon'] = "../../modules/".$aRec['directory']."/tool_icon.png";
}else{
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/tool.png";
}
}
if($aRec['function'] == 'snippet'){
}
if($aRec['function'] == 'snippet'){
++$aAddons['count_snippets'];
}
if($aRec['function'] == 'wysiwyg'){
++$aAddons['count_wysiwygeditors'];
++$aAddons['count_wysiwygeditors'];
}
if($aRec['function'] == 'snippet' || $aRec['function'] == 'page'){
if($aRec['function'] == 'snippet' || $aRec['function'] == 'page'){
$sIconFile = "/modules/".$aRec['directory']."/addon_icon.png";
if(is_readable(WB_PATH.$sIconFile)){
$aRec['icon'] = "../..".$sIconFile;
if(is_readable(WB_PATH.$sIconFile)){
$aRec['icon'] = "../..".$sIconFile;
}else{
$sType = ($aRec['function'] == 'snippet') ? 'snippet' : 'page_module';
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType.".png";
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType.".png";
}
}
}
// replace description if description in the current LANGUAGE exists
$sLanguageFile = sprintf($sLanguageFileLocation, $aRec['directory']);
if(is_readable($sLanguageFile)){
Expand All @@ -85,7 +85,7 @@ function getModulesArray(){
}
}
$aAddons['addons'][] = $aRec;
}
}
}
return $aAddons;
}
Expand All @@ -99,43 +99,43 @@ function getTemplatesArray(){
$aAddons['count_pagetemplates'] = 0;
$aAddons['count_acpthemes'] = 0;
$sQueryAddons = (
"SELECT DISTINCT a . * ,
IF( p.template IS NOT NULL , 'Y', 'N' ) AS active
FROM ".TABLE_PREFIX."addons a
LEFT JOIN ".TABLE_PREFIX."pages p
ON a.directory = p.template
"SELECT DISTINCT a . * ,
IF( p.template IS NOT NULL , 'Y', 'N' ) AS active
FROM ".TABLE_PREFIX."addons a
LEFT JOIN ".TABLE_PREFIX."pages p
ON a.directory = p.template
WHERE `function` = 'theme' OR `function` = 'template'
ORDER BY `function`, `name`"
);

if($oAddons = $database->query($sQueryAddons)){
// Loop through addons
while($aRec = $oAddons->fetchRow(MYSQL_ASSOC)){
while($aRec = $oAddons->fetchRow(MYSQLI_ASSOC)){
// grab for page_id's Addon is used on different pages
if($aRec['function'] == 'template'){
++$aAddons['count_pagetemplates'];
if($aRec['function'] == 'template'){
++$aAddons['count_pagetemplates'];
// grab for page_id's if Addon is used on different pages
if($aRec['active'] == 'Y'){
$sQueryActiveSections = ("SELECT `page_id` FROM `".TABLE_PREFIX."pages` WHERE `template` = '".$aRec['directory']."'");
if($oActiveSections = $database->query($sQueryActiveSections)){
while($aSections = $oActiveSections->fetchRow(MYSQL_ASSOC)){
while($aSections = $oActiveSections->fetchRow(MYSQLI_ASSOC)){
$aRec['active_pages'][] = $aSections['page_id'];
}
}
}
}
}
}
}else{
++$aAddons['count_acpthemes'];
}
// icon
$sIconFile = "/templates/".$aRec['directory']."/preview.jpg";
if(is_readable(WB_PATH.$sIconFile)){
$aRec['icon'] = "../..".$sIconFile;
if(is_readable(WB_PATH.$sIconFile)){
$aRec['icon'] = "../..".$sIconFile;
}else{
$sType = ($aRec['function'] == 'theme') ? 'acp_theme' : 'page_template';
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType."_preview.jpg";
}
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType."_preview.jpg";
}
$aAddons['addons'][] = $aRec;
}
}
}
return $aAddons;
}
Expand All @@ -145,37 +145,37 @@ function getLanguagesArray(){
global $database;
$aAddons['addons'] = array();
$sQueryAddons = (
"SELECT DISTINCT a . * ,
IF( p.language IS NOT NULL , 'Y', 'N' ) AS active
FROM ".TABLE_PREFIX."addons a
LEFT JOIN ".TABLE_PREFIX."pages p
ON a.directory = p.language
"SELECT DISTINCT a . * ,
IF( p.language IS NOT NULL , 'Y', 'N' ) AS active
FROM ".TABLE_PREFIX."addons a
LEFT JOIN ".TABLE_PREFIX."pages p
ON a.directory = p.language
WHERE type = 'language'"
);

if($oAddons = $database->query($sQueryAddons)){
// Loop through addons
while($aRec = $oAddons->fetchRow(MYSQL_ASSOC)){
while($aRec = $oAddons->fetchRow(MYSQLI_ASSOC)){
// grab for page_id's if Addon is used on different pages
if($aRec['active'] == 'Y'){
$sQueryActiveSections = ("SELECT `page_id` FROM `".TABLE_PREFIX."pages` WHERE `language` = '".$aRec['directory']."'");
if($oActiveSections = $database->query($sQueryActiveSections)){
while($aSections = $oActiveSections->fetchRow(MYSQL_ASSOC)){
while($aSections = $oActiveSections->fetchRow(MYSQLI_ASSOC)){
$aRec['active_pages'][] = $aSections['page_id'];
}
}
}
}
}
}
// icon
$sIconFile = "/languages/".strtolower($aRec['directory']).".png";
if(is_readable(WB_PATH.$sIconFile)){
$aRec['icon'] = "../..".$sIconFile;
if(is_readable(WB_PATH.$sIconFile)){
$aRec['icon'] = "../..".$sIconFile;
}else{
$sType = ($aRec['function'] == 'theme') ? 'acp_theme' : 'frontend_template';
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/unknown.png";
}
$aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/unknown.png";
}
$aAddons['addons'][] = $aRec;
}
}
}
return $aAddons;
}
}
}
2 changes: 1 addition & 1 deletion wbce/modules/addon_monitor/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$module_directory = 'addon_monitor';
$module_name = 'Addon Monitor';
$module_function = 'tool';
$module_version = '0.6.6';
$module_version = '0.6.7';
$module_status = 'stable';
$module_platform = '1.0.0';
$module_author = 'Christian M. Stefan (Stefek)';
Expand Down
4 changes: 2 additions & 2 deletions wbce/modules/droplets/example/ModifiedWhen.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//:Displays the last modification time of the current page
//:Use [[ModifiedWhen]]
//:Displays the last modification time of the current page
//:Use [[ModifiedWhen]]
global $database, $wb;if (PAGE_ID>0) { $query=$database->query("SELECT modified_when FROM ".TABLE_PREFIX."pages where page_id=".PAGE_ID); $mod_details=$query->fetchRow(); return "This page was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";}
Expand Down
6 changes: 3 additions & 3 deletions wbce/modules/droplets/example/NextPage.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//:Create a next link to your page
//:Display a link to the next page on the same menu level
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);// show next$nxt = $nSib < $nSibCount ? $nSib + 1 : 0;if ($nxt > 0) {return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$nxt){&gt;&gt; [a][menu_title]</a>}]", '', '', '');}else return '(no next)';
//:Create a next link to your page
//:Display a link to the next page on the same menu level
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);// show next$nxt = $nSib < $nSibCount ? $nSib + 1 : 0;if ($nxt > 0) {return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$nxt){&gt;&gt; [a][menu_title]</a>}]", '', '', '');}else return '(no next)';
Expand Down
6 changes: 3 additions & 3 deletions wbce/modules/droplets/example/Oneliner.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//:Create a random oneliner on your page
//:Use: [[OneLiner]]. The file with the oneliner data is located in /modules/droplets/example/oneliners.txt
$line = file (dirname(__FILE__)."/example/oneliners.txt");shuffle($line);return $line[0];
//:Create a random oneliner on your page
//:Use: [[OneLiner]]. The file with the oneliner data is located in /modules/droplets/example/oneliners.txt
$line = file (dirname(__FILE__)."/example/oneliners.txt");shuffle($line);return $line[0];
Expand Down
6 changes: 3 additions & 3 deletions wbce/modules/droplets/example/ParentPage.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//:Create a parent link to your page
//:Display a link to the parent page of the current page
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);// show up levelif ($nLevel > 0) {$lev = $nLevel - 1;return show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB|SM2_BUFFER, "[if(level==$lev){[a][menu_title]</a>}]", '', '', '');}else return '(no parent)';
//:Create a parent link to your page
//:Display a link to the parent page of the current page
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);// show up levelif ($nLevel > 0) {$lev = $nLevel - 1;return show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB|SM2_BUFFER, "[if(level==$lev){[a][menu_title]</a>}]", '', '', '');}else return '(no parent)';
Expand Down
6 changes: 3 additions & 3 deletions wbce/modules/droplets/example/PreviousPage.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//:Create a previous link to your page
//:Display a link to the previous page on the same menu level
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);// show previous$prv = $nSib > 1 ? $nSib - 1 : 0;if ($prv > 0) { return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$prv){[a][menu_title]</a> &lt;&lt;}]", '', '', '');}else return '(no previous)';
//:Create a previous link to your page
//:Display a link to the previous page on the same menu level
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);// show previous$prv = $nSib > 1 ? $nSib - 1 : 0;if ($prv > 0) { return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$prv){[a][menu_title]</a> &lt;&lt;}]", '', '', '');}else return '(no previous)';
Expand Down
4 changes: 2 additions & 2 deletions wbce/modules/droplets/example/SiteModified.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//:Create information on when your site was last updated.
//:Create information on when your site was last updated. Any page update counts.
//:Create information on when your site was last updated.
//:Create information on when your site was last updated. Any page update counts.
global $database, $wb;if (PAGE_ID>0) { $query=$database->query("SELECT max(modified_when) FROM ".TABLE_PREFIX."pages"); $mod_details=$query->fetchRow(); return "This site was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";}
Expand Down
6 changes: 3 additions & 3 deletions wbce/modules/droplets/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function wbce_copy_droplet($droplet_id)
TABLE_PREFIX, $droplet_id
));

$fetch_content = $query_content->fetchRow(MYSQL_ASSOC);
$fetch_content = $query_content->fetchRow(MYSQLI_ASSOC);
$code = addslashes(str_replace($tags, '', $fetch_content['code']));
$new_name = $fetch_content['name'] . "_copy";
$name = $new_name;
Expand Down Expand Up @@ -94,7 +94,7 @@ function wbce_copy_droplet($droplet_id)
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '</noscript>';
echo '</noscript>';
exit;
}
else {
Expand Down Expand Up @@ -438,7 +438,7 @@ function wbce_list_droplets()
if($query_droplets->numRows() > 0)
{
$list = array();
while ($droplet = $query_droplets->fetchRow(MYSQL_ASSOC))
while ($droplet = $query_droplets->fetchRow(MYSQLI_ASSOC))
{
if(is_array($droplet) && isset($droplet['name']))
{
Expand Down
7 changes: 5 additions & 2 deletions wbce/modules/droplets/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$module_directory = 'droplets';
$module_name = 'Droplets';
$module_function = 'tool';
$module_version = '2.2.7';
$module_version = '2.2.8';
$module_platform = '1.4.0';
$module_author = 'Ruud, pcwacht, WebBird, cwsoft, Norhei, Colinax';
$module_license = 'GNU General Public License';
Expand All @@ -26,9 +26,12 @@
/**
* Version history
*
* v2.2.8
* - MYSQL_ASSOC -> MYSQLI_ASSOC
*
* v2.2.7
* - Add module_level core status
* - Update module_platform
* - Update module_platform
*
* v2.2.6
* - SectionPicker Droplet uses Insert class
Expand Down
6 changes: 3 additions & 3 deletions wbce/modules/droplets/templates/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<br />
<button class="button" type="button" name="add_droplet" onclick="javascript: window.location = '{{ WB_URL }}/modules/droplets/add_droplet.php';">
{{ TEXT.ADD|raw }} {{ DR_TEXT.DROPLETS|raw }}
{{ TEXT.ADD|raw }}&nbsp;{{ DR_TEXT.DROPLETS|raw }}
</button>
<button class="button" type="button" name="upload_droplet" onclick="javascript: window.location = '{{ ADMIN_URL }}/admintools/tool.php?tool=droplets&amp;upload=1';">
{{ DR_TEXT.UPLOAD|raw }}
Expand All @@ -11,9 +11,9 @@
{{ DR_TEXT.BACKUP|raw }}
</button>
{% if backup_mgmt %}
<button class="button" type="button" name="backup_mgmt" onclick="javascript: window.location = '{{ ADMIN_URL }}/admintools/tool.php?tool=droplets&amp;do=manage_backups';">
<button class="button" type="button" name="backup_mgmt" onclick="javascript: window.location = '{{ ADMIN_URL }}/admintools/tool.php?tool=droplets&amp;do=manage_backups';">
{{ DR_TEXT.MANAGE_BACKUPS|raw }}
</button>'
</button>
{% endif %}

<a href="#" style="float:right" onclick="javascript: window.open('{{ WB_URL }}/modules/droplets/readme/{{ DR_TEXT.README|raw }}','helpwindow','width=700,height=550,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');">
Expand Down
4 changes: 2 additions & 2 deletions wbce/modules/droplets/tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
if(is_array($list) AND count($list)) {
$twig_data['info'] = wbce_export_droplets($list);
}
}
}
break;
// ----- import -----
case 'upload':
Expand Down Expand Up @@ -134,7 +134,7 @@
"SELECT * FROM `%smod_droplets` WHERE `id` = '%d'",
TABLE_PREFIX, $droplet_id
));
$fetch_content = $query_content->fetchRow(MYSQL_ASSOC);
$fetch_content = $query_content->fetchRow(MYSQLI_ASSOC);

$twig_data['content'] = wbce_twig_display(
array('data'=>$fetch_content),
Expand Down
6 changes: 4 additions & 2 deletions wbce/modules/jsadmin/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$module_directory = 'jsadmin';
$module_name = 'Javascript Admin';
$module_function = 'tool';
$module_version = '1.4.3';
$module_version = '1.4.4';
$module_platform = '1.4.0';
$module_author = 'Stepan Riha, Swen Uth';
$module_license = 'BSD License';
Expand All @@ -24,9 +24,11 @@
/**
* Version history
*
* 1.4.4 - fixes for MySQL-Strict (Bernd)
*
* 1.4.3
* - Add module_level core status
* - Update module_platform
* - Update module_platform
*
* 1.4.2
* - Add Admintool Icon
Expand Down
Loading

0 comments on commit 6f1a066

Please sign in to comment.