Skip to content

Commit

Permalink
Creating development branch from trunk.
Browse files Browse the repository at this point in the history
  • Loading branch information
trisweb committed Jan 11, 2011
0 parents commit 462c369
Show file tree
Hide file tree
Showing 1,472 changed files with 383,176 additions and 0 deletions.
Empty file added albums/.gitignore
Empty file.
Empty file added cache/.gitignore
Empty file.
Empty file added cache_html/rss/.gitignore
Empty file.
2 changes: 2 additions & 0 deletions dev-tools/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The files in this folder are intended as tools for Zenphoto development. They are NOT
part of the gallery support. This folder does not belong in the server installation.
28 changes: 28 additions & 0 deletions dev-tools/test_deprecated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
$plugin_description = gettext("Test the messages of deprecated functions.");
$plugin_author = "Stephen Billard (sbillard)";
$plugin_disable = (getOption('zp_plugin_deprecated-functions')?'':gettext('deprecated-functions is not enabled.'));

if (!$plugin_disable) {
zp_register_filter('theme_head', 'test_deprecated_test');
}

function test_deprecated_test() {
$deprecated = file_get_contents(ZENFOLDER.'/'.PLUGIN_FOLDER.'/deprecated-functions.php');
$i = strpos($deprecated, '//'.' IMPORTANT:: place all deprecated functions below this line!!!');
$deprecated = substr($deprecated, $i);
preg_match_all('/function\040+(.*)\040?\(.*\)\040?\{/',$deprecated,$functions);
$listed_functions = $functions[1];
// remove the items from this class and notify function, leaving only the deprecated functions
foreach ($listed_functions as $key=>$funct) {
if ($funct == '_emitPluginScripts') { // special case!!!!
unset($listed_functions[$key]);
} else {
if (getOption('deprecated_'.$funct)) { // only error message enabled ones.
echo "<br />$funct::";
call_user_func_array($funct,array(0,0,0,0));
}
}
}
}
?>
40 changes: 40 additions & 0 deletions dev-tools/zenphoto_package.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/* Creates the zenphoto.package file
*
* @package plugins
*/
$plugin_is_filter = 5|ADMIN_PLUGIN;
$plugin_description = gettext('Generates the <em>zenphoto.package</em> file.');
$plugin_author = "Stephen Billard (sbillard)";
$plugin_version = '1.4.0';
$option_interface = 'zenphoto_package';

zp_register_filter('admin_utilities_buttons', 'zenphoto_package_button');

class zenphoto_package {
function zenphoto_package() {
setOptionDefault('zenphoto_package_path', DATA_FOLDER);
}

function getOptionsSupported() {
return array(gettext('Folder') => array('key' => 'zenphoto_package_path', 'type' => OPTION_TYPE_SELECTOR,
'selections' => array(DATA_FOLDER=>DATA_FOLDER,ZENFOLDER=>ZENFOLDER,UPLOAD_FOLDER=>UPLOAD_FOLDER),
'desc' => gettext('Place the package file in this folder.')));
}
}

function zenphoto_package_button($buttons) {
$buttons[] = array(
'enable'=>true,
'button_text'=>gettext('Create package'),
'formname'=>'zenphoto_package_button',
'action'=>WEBPATH.'/plugins/zenphoto_package/zenphoto_package_generator.php',
'icon'=>'images/down.png',
'title'=>gettext('Download new Zenphoto package file'),
'alt'=>'',
'hidden'=>'',
'rights'=>ADMIN_RIGHTS,
);
return $buttons;
}
?>
68 changes: 68 additions & 0 deletions dev-tools/zenphoto_package/zenphoto_package_generator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
/**
* Zenphoto package list generator
*
* @author Stephen Billard (sbillard)
* @package plugins
*/

// force UTF-8 Ø

define("OFFSET_PATH",3);
require_once("../../zp-core/admin-functions.php");
$stdExclude = Array( '.', '..','.DS_Store','.cache','Thumbs.db','.htaccess','.svn','debug.html');
$_zp_resident_files = getResidentFiles(SERVERPATH,array_merge($stdExclude, array('favicon.ico','robots.txt','albums','backup','cache','cache_html','plugins','themes','uploaded','zp-core','zp-data','.buildpath','.project','.settings','doc_files','dev-tools')));

$_zp_resident_files[] = THEMEFOLDER;

$_zp_resident_files[] = THEMEFOLDER.'/default';
$_zp_resident_files = array_merge($_zp_resident_files,getResidentFiles(SERVERPATH.'/'.THEMEFOLDER.'/default',$stdExclude));

$_zp_resident_files[] = THEMEFOLDER.'/effervescence_plus';
$_zp_resident_files = array_merge($_zp_resident_files,getResidentFiles(SERVERPATH.'/'.THEMEFOLDER.'/effervescence_plus',$stdExclude));

$_zp_resident_files[] = THEMEFOLDER.'/stopdesign';
$_zp_resident_files = array_merge($_zp_resident_files,getResidentFiles(SERVERPATH.'/'.THEMEFOLDER.'/stopdesign',$stdExclude));

$_zp_resident_files[] = THEMEFOLDER.'/zenpage';
$_zp_resident_files = array_merge($_zp_resident_files,getResidentFiles(SERVERPATH.'/'.THEMEFOLDER.'/zenpage',$stdExclude));

$_zp_resident_files[] = ZENFOLDER;
$_zp_resident_files = array_merge($_zp_resident_files,getResidentFiles(SERVERPATH.'/'.ZENFOLDER,$stdExclude));

natsort($_zp_resident_files);
$filepath = SERVERPATH.'/'.getOption('zenphoto_package_path').'/Zenphoto.package';
$fp = fopen($filepath, 'w');
foreach ($_zp_resident_files as $component) {
fwrite($fp,$component."\n");
}
fwrite($fp,count($_zp_resident_files));
fclose($fp);
clearstatcache();
header('Location: '.FULLWEBPATH.'/'.ZENFOLDER.'/admin.php?action=external&msg=Zenphoto package created and stored in the '.getOption('zenphoto_package_path').' folder.');
exit();

/**
*
* enumerates the files in folder(s)
* @param $folder
*/
function getResidentFiles($folder,$exclude) {
global $_zp_resident_files;
$dirs = array_diff(scandir($folder),$exclude);
$localfiles = array();
$localfolders = array();
foreach($dirs as $file) {
$file = str_replace('\\','/',$file);
$key = str_replace(SERVERPATH.'/', '', filesystemToInternal($folder.'/'.$file));
if (is_dir($folder.'/'.$file)) {
$localfolders[] = $key;
$localfolders = array_merge($localfolders, getResidentFiles($folder.'/'.$file,$exclude));
} else {
$localfiles[] = $key;
}
}
return array_merge($localfiles,$localfolders);
}

?>
Loading

0 comments on commit 462c369

Please sign in to comment.