Skip to content

Commit

Permalink
updated to v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman committed Apr 13, 2018
1 parent cd34b90 commit 435ca35
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 54 deletions.
14 changes: 12 additions & 2 deletions admin/scripts/backend.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ function getFolderStructureIterator(
/*---------------------------------------------------------------------------------------------------*/
//
/*----------------------------------- glob routines -----------------------------------------------*/
function scanGlobTree ($sPath, $sPattern = '[a-zA-Z0-9_~@]*'){
return (\glob($sPath.$sPattern, \GLOB_MARK)); // \GLOB_ONLYDIR|
function scanGlobTree ($sPath, $sPattern = '{,^.}[a-zA-Z0-9_~@]*'){
return (\glob($sPath.$sPattern, \GLOB_BRACE|\GLOB_MARK)); // \GLOB_ONLYDIR|
}

/**
Expand Down Expand Up @@ -662,6 +662,16 @@ function getCategories($galerie, $searchCategorie = '', $modus = 1, $rekursiv =
$catParents = $searchCategorie.str_replace(WB_PATH.$MediaRel, '',$catParents);//$path
// $catParents = ($catParents==''?'Root':$catParents);
if ($catParents!='' && is_readable($path.$catParents)){
/*
$sAllowedExtensions = implode(',', $aAllowedExtensions);
function scanGlobTree ($sPath, $sPattern = '{,^.}[a-zA-Z0-9_~@]*'){
return (\glob($sPath.$sPattern, \GLOB_BRACE|\GLOB_MARK)); // \GLOB_ONLYDIR|
}
$sSearchFilter = DIRECTORY_SEPARATOR.'{,.}{'.$sAllowedExtensions.'}';
$sSearchFilter = '*';
$aFilesInDir = (\glob($path.$catParents.$sSearchFilter, \GLOB_BRACE)); // \GLOB_ONLYDIR
*/
// $aFilesInDir = glob ($sSearchFilter, GLOB_BRACE);
$sSearchFilter = '/*.{'.$sAllowedExtensions.'}';
$aFilesInDir = scanGlobTree($path.$catParents, $sSearchFilter);
if (is_array($aFilesInDir) && sizeof($aFilesInDir)){
Expand Down
6 changes: 3 additions & 3 deletions info.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
if (!defined('SYSTEM_RUN')) { header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); flush(); exit; }

$module_directory = 'foldergallery';
$module_name = 'Foldergallery v3.0.0-dev5';
$module_name = 'Foldergallery v2.2.0';
$module_function = 'page';
$module_version = '3.0.0-dev5';
$module_version = '2.2.0';
$module_status = '';
$module_platform = '2.11.0';
$module_platform = '2.10.0';

$module_author = 'Jürg Rast, schliffer, Bianka Martinovic, Chio, Pumpi, Luisehahne';
$module_license = 'GNU General Public License';
Expand Down
65 changes: 32 additions & 33 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,35 @@
/* -------------------------------------------------------- */
$sCallingScript = $_SERVER['SCRIPT_NAME'];

$globalStarted = \preg_match('/upgrade\-script\.php$/', $sCallingScript);
$sWbVersion = ($globalStarted && \defined('VERSION') ? VERSION : WB_VERSION);
$globalStarted = preg_match('/upgrade\-script\.php$/', $sCallingScript);
$sWbVersion = ($globalStarted && defined('VERSION') ? VERSION : WB_VERSION);
switch ($iSteps):
case 5:
$sAddonPath = \dirname(\dirname(\dirname(__DIR__)));
$sAddonPath = dirname(dirname(dirname(__DIR__)));
break;
case 4:
$sAddonPath = \dirname(\dirname(__DIR__));
$sAddonPath = dirname(dirname(__DIR__));
break;
case 3:
$sAddonPath = \dirname(__DIR__);
$sAddonPath = dirname(__DIR__);
break;
case 2:
default:
$sAddonPath = __DIR__;
endswitch;

$bExcecuteCommand = false;
// needed for simple Dispatcher
$sAddonName = \basename($sAddonPath);
$sAddonName = basename($sAddonPath);
// An associative array that by default contains the contents of $_GET, $_POST and $_COOKIE.
$aRequestVars = $_REQUEST;
if (\is_readable(\dirname(__DIR__).'/SimpleCommandDispatcher.inc')) {require(\dirname(__DIR__).'/SimpleCommandDispatcher.inc');}
if (is_readable(dirname(__DIR__).'/SimpleCommandDispatcher.inc')) {require(dirname(__DIR__).'/SimpleCommandDispatcher.inc');}
// if (isset($sAddonBaseDir)) { exit; }

// $sCallingScript = $_SERVER['SCRIPT_NAME'];

/*--------------------------------------------------------------------------------------------------------*/
$unixPath = (function ($string){
return \str_replace('\\', '/', $string);
return str_replace('\\', '/', $string);
});
/*--------------------------------------------------------------------------------------------------------*/
/**
Expand All @@ -80,7 +79,7 @@
function index_exists($table_name, $index_name, $number_fields = 0)
{
global $database;
$number_fields = \intval($number_fields);
$number_fields = intval($number_fields);
$keys = 0;
$sql = 'SHOW INDEX FROM `'.$table_name.'`';
if (($res_keys = $database->query($sql))) {
Expand Down Expand Up @@ -119,9 +118,9 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields)
global $database;
if( !is_array($key))
{
if (\trim($key) != '' )
if( trim($key) != '' )
{
$key = array( \trim($key) => \trim($value) );
$key = array( trim($key) => trim($value) );
} else {
$key = [];
}
Expand All @@ -141,7 +140,7 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields)
$iFirst++;
}
}
$aExtraFieldsList = \array_intersect_key($aTmp, $aExtraFields);
$aExtraFieldsList = array_intersect_key($aTmp, $aExtraFields);
foreach($aExtraFieldsList as $sName=>$sValue){
$sExtraFields .= '`'.$sName.'` = \''.$sValue.'\', ';
}
Expand All @@ -156,7 +155,7 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields)
. 'WHERE `s_name` = \''.$index.'\' '
. (($aIndexField['0']!='') ? 'AND '. $aIndexField['0'] : '');

if ($database->get_one($sql))
if($database->get_one($sql))
{
$sql = 'UPDATE ';
$sql_where = 'WHERE `s_name` LIKE \''.$index.'\'';
Expand All @@ -174,7 +173,7 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields)
$retval[]=$database->get_error();
}
}
return ((\sizeof($retval)==0) ? true : $retval);
return ((sizeof($retval)==0) ? true : $retval);
};
}
/*--------------------------------------------------------------------------------------*/
Expand All @@ -192,26 +191,26 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields)
if(!$color) return false;
$color = trim($color);
$result = false;
if (\preg_match("/^[0-9ABCDEFabcdef\#]+$/i", $color)){
if(preg_match("/^[0-9ABCDEFabcdef\#]+$/i", $color)){
$hex = str_replace('#','', $color);
if(!$hex) return false;
if(strlen($hex) == 3):
$result['r'] = \hexdec(\substr($hex,0,1).\substr($hex,0,1));
$result['g'] = \hexdec(\substr($hex,1,1).\substr($hex,1,1));
$result['b'] = \hexdec(\substr($hex,2,1).\substr($hex,2,1));
$result['r'] = hexdec(substr($hex,0,1).substr($hex,0,1));
$result['g'] = hexdec(substr($hex,1,1).substr($hex,1,1));
$result['b'] = hexdec(substr($hex,2,1).substr($hex,2,1));
else:
$result['r'] = \hexdec(\substr($hex,0,2));
$result['g'] = \hexdec(\substr($hex,2,2));
$result['b'] = \hexdec(\substr($hex,4,2));
$result['r'] = hexdec(substr($hex,0,2));
$result['g'] = hexdec(substr($hex,2,2));
$result['b'] = hexdec(substr($hex,4,2));
endif;
}elseif (\preg_match("/^[0-9]+(,| |.)+[0-9]+(,| |.)+[0-9]+$/i", $color)){
$rgbstr = \str_replace(array(',',' ','.'), ':', $color);
$rgbarr = \explode(":", $rgbstr);
}elseif (preg_match("/^[0-9]+(,| |.)+[0-9]+(,| |.)+[0-9]+$/i", $color)){
$rgbstr = str_replace(array(',',' ','.'), ':', $color);
$rgbarr = explode(":", $rgbstr);
$result = '#';
$result .= \str_pad(\dechex($rgbarr[0]), 2, "0", \STR_PAD_LEFT);
$result .= \str_pad(\dechex($rgbarr[1]), 2, "0", \STR_PAD_LEFT);
$result .= \str_pad(\dechex($rgbarr[2]), 2, "0", \STR_PAD_LEFT);
$result = \strtoupper($result);
$result .= str_pad(dechex($rgbarr[0]), 2, "0", STR_PAD_LEFT);
$result .= str_pad(dechex($rgbarr[1]), 2, "0", STR_PAD_LEFT);
$result .= str_pad(dechex($rgbarr[2]), 2, "0", STR_PAD_LEFT);
$result = strtoupper($result);
}else{
$result = false;
}
Expand All @@ -220,19 +219,19 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields)

$convertToCategory = (function ($sList)
{
if (\is_array($sList)){
if (is_array($sList)){
return $sList;
}
// return preg_split('/[\s,=+\;\:\.\/\|]+/', $sList, -1, PREG_SPLIT_NO_EMPTY);
return \preg_split('/[,=+\;\:\/\|]+/', $sList, -1, \PREG_SPLIT_NO_EMPTY);
return preg_split('/[,=+\;\:\/\|]+/', $sList, -1, PREG_SPLIT_NO_EMPTY);
});

$convertToArray = (function ($sList)
{
if (\is_array($sList)){
if (is_array($sList)){
return $sList;
}
return \preg_split('/[\s,=+\;\:\.\|]+/', $sList, -1, \PREG_SPLIT_NO_EMPTY);
return preg_split('/[\s,=+\;\:\.\|]+/', $sList, -1, PREG_SPLIT_NO_EMPTY);
});
/*--------------------------------------------------------------------------------------*/

Expand Down
6 changes: 3 additions & 3 deletions templates/default/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ div.images{overflow:hidden;padding:0.525em;}
div.images div{overflow:hidden;padding:0.525em;text-align:center;white-space:normal;}
ul.photostyle{list-style:none;margin:0 0 5px 0;padding:0;display:inline;text-align:center;}
ul.photostyle li{padding:4px;border-radius:5px 5px 5px 5px;-webkit-border-radius:5px 5px 5px 5px;-moz-border-radius:5px 5px 5px 5px;}
ul.photostyle li{display:inline-block;list-style-type:none;padding-right:0.1225em;}
ul.photostyle li{display:inline;list-style-type:none;padding-right:0.1225em;}
ul.photostyle li a img{border:0 none;}
.htt-caption{display:block;}
ul.categories{list-style:none;margin:0 0 5px 0;}
Expand All @@ -44,7 +44,7 @@ ul.categories li a img{max-width:100%;transition:0.5s ease;-o-transition:0.5s ea
.clear{clear:left;padding-top:0px;border:0px none #000000;border-bottom:1px none #000000;}
.cat-naslov{font-size:12px;text-align:center;margin-top:2px;line-height:1;padding:0 1px 0 1px;}
div.categories{border-radius:0.525em;box-shadow:0 0 1px #888888;display:inline-block;margin:0.125em;background:#fff;overflow:hidden;position:relative;}
div.categories:hover{box-shadow:0 0 10px #888888;}
div.categories:hover{box-shadow:0 0 6px #888888;}
div.categories .categories-image{width:100%;}
.categories-info{backface-visibility:hidden;background:#fff none repeat scroll 0 0;padding:0.525em;position:absolute;transition:all 0.4s ease 0s;z-index:10;}
div.pagination{text-align:left !important;}
Expand All @@ -62,7 +62,7 @@ div.categories-info{height:100%;padding:0.925em 0.5525em;margin-top:-40%;}
div.categories-info div.pagination{width:100%;padding-top:relative;}
div.categories-info div.pagination ul{width:100%;position:absolute;margin-left:0 !important;}
div.categories-info div.pagination ul{margin:auto 0.0em;padding:0;text-align:center;left:0;}
div.categories{padding-bottom:10.025%;height:11.925em;box-shadow:0px 0px 6px #888888;}
div.categories{padding-bottom:10.025%;height:11.925em;}
div.categories-info div.pagination ul{bottom:40%;position:relative;}
div.categories .social-media li{margin-right:4px;}
div.categories .social-media li:last-child{margin-right:0;}
Expand Down
3 changes: 1 addition & 2 deletions themes/default/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,4 @@ input[type=range ],::-moz-range-track,::-ms-track{-webkit-appearance:normal;back
.level-10{font-weight:bold;color:#959595;}
img.fg{margin-bottom:3px!important;}
.thumbb{max-height:100px;margin:10px 0 10px 0;}
input[type="radio"]+ label,input[type="checkbox"]+ label,input[type="checkbox"]+ td label{font-weight:normal;padding:0 1.325em 0 0.825em;vertical-align:middle;}

input[type="radio"]+ label,input[type="checkbox"]+ label,input[type="checkbox"]+ td label{font-weight:normal;padding:0 1.325em 0 0.825em;vertical-align:middle;}
8 changes: 1 addition & 7 deletions themes/default/modify_cat.htt
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,12 @@ console.info(elm);
includeExif: true,
orient: true,
sizes: [
{name: "", maxSize: (upSettings.maxImageSize < 1600 ? upSettings.maxImageSize : 1536 ) }
{name: "", maxSize: (upSettings.maxImageSize<1600?upSettings.maxImageSize:1536 ) }
]
},
text: {
failUpload: 'Upload files are failed',
},
callbacks: {
onAllComplete: function() {
alert('done');
document.location.href="{AddonUrl}/admin/sync.php?page_id="+upSettings.pageID+"&section_id="+upSettings.sectionID;
}
},
debug: true
});
qq(document.getElementById("trigger-upload")).attach("click", function() {
Expand Down
2 changes: 1 addition & 1 deletion upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// check if upgrade startet by upgrade-script to echo a message
$globalStarted = preg_match('/upgrade\-script\.php$/', $_SERVER["SCRIPT_NAME"]);
$sWbVersion = ($globalStarted && defined('VERSION') ? VERSION : WB_VERSION);
Translate::getInstance()->enableAddon(ADMIN_DIRECTORY.'\\addons');
Translate::getInstance()->enableAddon(ADMIN_DIRECTORY.'\\addons');
if (is_writable(WB_PATH.'/temp/cache')) {
Translate::getInstance()->clearCache();
}
Expand Down
14 changes: 11 additions & 3 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@
$katcount[$ix] = '';
};

/*
*/
if($katcount[$ix] == "1") {
$katcount[$ix].= " ".$MOD_FOLDERGALLERY['1PICTURE'];
} else if($katcount[$ix] == "2") {
Expand All @@ -469,14 +471,17 @@
$katcount[$ix].= " ".$MOD_FOLDERGALLERY['PICTURES'];
}
};
/*
print '<pre class="mod-pre rounded">function <span>'.__FUNCTION__.'( '.$iRatio.' );</span> filename: <span>'.basename(__FILE__).'</span> line: '.__LINE__.' -> <br />';
print_r( $bilder ); print '</pre>'; flush (); // ob_flush();;sleep(10); die();
*/
$sCatGalleryLink = $unterKats[$ix]['link'];
$sCatThumbUrl = (!is_dir($unterKats[$ix]['thumb'])? $unterKats[$ix]['thumb']:'');
$sCatName = $unterKats[$ix]['name'];
#$t->set_var('CATEGORIES_TITLE', $MOD_FOLDERGALLERY['CATEGORIES_TITLE']);
$isEmpty = ((intval($katcount[$ix])==0)?true:$isEmpty);
$bIsThumbLink = ($sCatThumbUrl);
if ($isEmpty &&!$bIsAdmin){continue;}

$aCategorie = array(
'CAT_LINK' => $sCatGalleryLink,
'THUMB_LINK' => $sCatThumbUrl.'?t='.time(),
Expand All @@ -487,7 +492,10 @@
'IsEmpty' =>$isEmpty
);
$t->set_var($aCategorie);

/*
print '<pre class="mod-pre rounded">function <span>'.__FUNCTION__.'( '.''.' );</span> filename: <span>'.basename(__FILE__).'</span> line: '.__LINE__.' -> <br />';
print_r( $aCategorie ); print '</pre>'; flush (); // ob_flush();;sleep(10); die();
*/
$iRatio = (float)($thumbPresets[$settings ['loadPreset']]['thumb_ratio']);
$iRatio = (float)($iRatio>1?$iRatio:1.34);
$catWidth = (float)$settings['tbSettings']['image_x'];
Expand Down Expand Up @@ -632,7 +640,7 @@
$sImageFile = function ($sImage) use ($ImgInfo){
return __DIR__.'/preview.php?img='.$sImage; // '
};
$sFilename = $url.$pathToFolder.$sOrginalFilename;
$sFilename = $pathToFolder.$sOrginalFilename;
// $sImageFilename = $sImageFile($pathToFolder.$sOrginalFilename);

$aShowImages = [
Expand Down

0 comments on commit 435ca35

Please sign in to comment.