From 4486af7be8c0f3272d3a577906cb246201c91a9c Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Wed, 11 Jan 2012 00:28:17 +0000 Subject: [PATCH 01/10] Update directory layout to fit with other projects --- .gitignore | 4 ++-- htaccess.dist => private/htaccess.dist | 0 {webui => public}/_inc.php | 0 {webui => public}/a.php | 0 {webui => public}/images/caution.png | Bin {webui => public}/images/clock.png | Bin .../images/jquery.progressbar/progressbar.gif | Bin .../jquery.progressbar/progressbg_black.gif | Bin .../jquery.progressbar/progressbg_green.gif | Bin .../jquery.progressbar/progressbg_orange.gif | Bin .../jquery.progressbar/progressbg_red.gif | Bin .../jquery.progressbar/progressbg_yellow.gif | Bin {webui => public}/images/redo.png | Bin {webui => public}/images/trash.png | Bin {webui => public}/index.php | 0 {webui => public}/run-jobs.php | 0 .../scripts/3rdparty/jquery.asmselect.js | 0 .../scripts/3rdparty/jquery.jec-1.3.2.js | 0 .../3rdparty/jquery.progressbar.min.js | 0 {webui => public}/scripts/main.js | 0 .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin .../images/ui-bg_flat_75_ffffff_40x100.png | Bin .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin .../images/ui-bg_glass_65_ffffff_1x400.png | Bin .../images/ui-bg_glass_75_dadada_1x400.png | Bin .../images/ui-bg_glass_75_e6e6e6_1x400.png | Bin .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin .../images/ui-icons_222222_256x240.png | Bin .../images/ui-icons_2e83ff_256x240.png | Bin .../images/ui-icons_454545_256x240.png | Bin .../images/ui-icons_888888_256x240.png | Bin .../images/ui-icons_cd0a0a_256x240.png | Bin .../smoothness/jquery-ui-1.8.custom.css | 0 .../styles/3rdparty/jquery.asmselect.css | 0 {webui => public}/styles/normal.css | 0 source/lib/RippingCluster/Main.class.php | 19 ++++++++++++------ .../webui}/pages/admin/settings.php | 0 .../webui}/pages/ajax/admin/add-setting.php | 0 .../pages/ajax/admin/remove-setting.php | 0 .../pages/ajax/admin/rename-setting.php | 0 .../webui}/pages/ajax/delete-source.php | 0 .../webui}/pages/ajax/source-list.php | 0 .../webui}/pages/ajax/update-settings.php | 0 .../webui}/pages/errors/404.php | 0 .../pages/errors/unhandled-exception.php | 0 {webui/source => source/webui}/pages/home.php | 0 {webui/source => source/webui}/pages/jobs.php | 0 .../webui}/pages/jobs/details.php | 0 {webui/source => source/webui}/pages/logs.php | 0 .../webui}/pages/rips/setup.php | 0 .../webui}/pages/sources/delete.php | 0 .../webui}/pages/sources/details.php | 0 .../webui}/pages/sources/list.php | 0 .../webui}/smarty/plugins/compiler.switch.php | 0 .../webui}/templates/admin/settings.tpl | 0 .../webui}/templates/ajax.tpl | 0 .../templates/ajax/admin/add-setting.tpl | 0 .../templates/ajax/admin/new-setting.tpl | 0 .../templates/ajax/admin/remove-setting.tpl | 0 .../templates/ajax/admin/rename-setting.tpl | 0 .../webui}/templates/ajax/delete-source.tpl | 0 .../webui}/templates/ajax/source-list.tpl | 0 .../webui}/templates/ajax/update-settings.tpl | 0 .../webui}/templates/errors/404.tpl | 0 .../templates/errors/unhandled-exception.tpl | 0 .../templates/fragments/admin-setting-row.tpl | 0 .../fragments/admin-setting-value.tpl | 0 .../templates/fragments/delete-source.tpl | 0 .../webui}/templates/fragments/messages.tpl | 0 .../fragments/new-setting-dialog.tpl | 0 .../fragments/rename-setting-dialog.tpl | 0 .../templates/fragments/source-list.tpl | 0 .../fragments/update-settings-dialog.tpl | 0 .../webui}/templates/home.tpl | 0 .../webui}/templates/index.tpl | 0 .../webui}/templates/jobs.tpl | 0 .../webui}/templates/jobs/details.tpl | 0 .../webui}/templates/logs.tpl | 0 .../webui}/templates/navigation.tpl | 0 .../webui}/templates/rips/setup.tpl | 0 .../webui}/templates/sidebar.tpl | 0 .../webui}/templates/sources/delete.tpl | 0 .../webui}/templates/sources/details.tpl | 0 .../webui}/templates/sources/list.tpl | 0 .../worker}/ripping-cluster-worker.php | 0 86 files changed, 15 insertions(+), 8 deletions(-) rename htaccess.dist => private/htaccess.dist (100%) rename {webui => public}/_inc.php (100%) rename {webui => public}/a.php (100%) rename {webui => public}/images/caution.png (100%) rename {webui => public}/images/clock.png (100%) rename {webui => public}/images/jquery.progressbar/progressbar.gif (100%) rename {webui => public}/images/jquery.progressbar/progressbg_black.gif (100%) rename {webui => public}/images/jquery.progressbar/progressbg_green.gif (100%) rename {webui => public}/images/jquery.progressbar/progressbg_orange.gif (100%) rename {webui => public}/images/jquery.progressbar/progressbg_red.gif (100%) rename {webui => public}/images/jquery.progressbar/progressbg_yellow.gif (100%) rename {webui => public}/images/redo.png (100%) rename {webui => public}/images/trash.png (100%) rename {webui => public}/index.php (100%) rename {webui => public}/run-jobs.php (100%) rename {webui => public}/scripts/3rdparty/jquery.asmselect.js (100%) rename {webui => public}/scripts/3rdparty/jquery.jec-1.3.2.js (100%) rename {webui => public}/scripts/3rdparty/jquery.progressbar.min.js (100%) rename {webui => public}/scripts/main.js (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png (100%) rename {webui => public}/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css (100%) rename {webui => public}/styles/3rdparty/jquery.asmselect.css (100%) rename {webui => public}/styles/normal.css (100%) rename {webui/source => source/webui}/pages/admin/settings.php (100%) rename {webui/source => source/webui}/pages/ajax/admin/add-setting.php (100%) rename {webui/source => source/webui}/pages/ajax/admin/remove-setting.php (100%) rename {webui/source => source/webui}/pages/ajax/admin/rename-setting.php (100%) rename {webui/source => source/webui}/pages/ajax/delete-source.php (100%) rename {webui/source => source/webui}/pages/ajax/source-list.php (100%) rename {webui/source => source/webui}/pages/ajax/update-settings.php (100%) rename {webui/source => source/webui}/pages/errors/404.php (100%) rename {webui/source => source/webui}/pages/errors/unhandled-exception.php (100%) rename {webui/source => source/webui}/pages/home.php (100%) rename {webui/source => source/webui}/pages/jobs.php (100%) rename {webui/source => source/webui}/pages/jobs/details.php (100%) rename {webui/source => source/webui}/pages/logs.php (100%) rename {webui/source => source/webui}/pages/rips/setup.php (100%) rename {webui/source => source/webui}/pages/sources/delete.php (100%) rename {webui/source => source/webui}/pages/sources/details.php (100%) rename {webui/source => source/webui}/pages/sources/list.php (100%) rename {webui/source => source/webui}/smarty/plugins/compiler.switch.php (100%) rename {webui/source => source/webui}/templates/admin/settings.tpl (100%) rename {webui/source => source/webui}/templates/ajax.tpl (100%) rename {webui/source => source/webui}/templates/ajax/admin/add-setting.tpl (100%) rename {webui/source => source/webui}/templates/ajax/admin/new-setting.tpl (100%) rename {webui/source => source/webui}/templates/ajax/admin/remove-setting.tpl (100%) rename {webui/source => source/webui}/templates/ajax/admin/rename-setting.tpl (100%) rename {webui/source => source/webui}/templates/ajax/delete-source.tpl (100%) rename {webui/source => source/webui}/templates/ajax/source-list.tpl (100%) rename {webui/source => source/webui}/templates/ajax/update-settings.tpl (100%) rename {webui/source => source/webui}/templates/errors/404.tpl (100%) rename {webui/source => source/webui}/templates/errors/unhandled-exception.tpl (100%) rename {webui/source => source/webui}/templates/fragments/admin-setting-row.tpl (100%) rename {webui/source => source/webui}/templates/fragments/admin-setting-value.tpl (100%) rename {webui/source => source/webui}/templates/fragments/delete-source.tpl (100%) rename {webui/source => source/webui}/templates/fragments/messages.tpl (100%) rename {webui/source => source/webui}/templates/fragments/new-setting-dialog.tpl (100%) rename {webui/source => source/webui}/templates/fragments/rename-setting-dialog.tpl (100%) rename {webui/source => source/webui}/templates/fragments/source-list.tpl (100%) rename {webui/source => source/webui}/templates/fragments/update-settings-dialog.tpl (100%) rename {webui/source => source/webui}/templates/home.tpl (100%) rename {webui/source => source/webui}/templates/index.tpl (100%) rename {webui/source => source/webui}/templates/jobs.tpl (100%) rename {webui/source => source/webui}/templates/jobs/details.tpl (100%) rename {webui/source => source/webui}/templates/logs.tpl (100%) rename {webui/source => source/webui}/templates/navigation.tpl (100%) rename {webui/source => source/webui}/templates/rips/setup.tpl (100%) rename {webui/source => source/webui}/templates/sidebar.tpl (100%) rename {webui/source => source/webui}/templates/sources/delete.tpl (100%) rename {webui/source => source/webui}/templates/sources/details.tpl (100%) rename {webui/source => source/webui}/templates/sources/list.tpl (100%) rename {worker => source/worker}/ripping-cluster-worker.php (100%) diff --git a/.gitignore b/.gitignore index f658d81..0a3189b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,5 @@ .settings /config.php /dbconfig.conf -/webui/.htaccess -/webui/tmp/* +/public/.htaccess + diff --git a/htaccess.dist b/private/htaccess.dist similarity index 100% rename from htaccess.dist rename to private/htaccess.dist diff --git a/webui/_inc.php b/public/_inc.php similarity index 100% rename from webui/_inc.php rename to public/_inc.php diff --git a/webui/a.php b/public/a.php similarity index 100% rename from webui/a.php rename to public/a.php diff --git a/webui/images/caution.png b/public/images/caution.png similarity index 100% rename from webui/images/caution.png rename to public/images/caution.png diff --git a/webui/images/clock.png b/public/images/clock.png similarity index 100% rename from webui/images/clock.png rename to public/images/clock.png diff --git a/webui/images/jquery.progressbar/progressbar.gif b/public/images/jquery.progressbar/progressbar.gif similarity index 100% rename from webui/images/jquery.progressbar/progressbar.gif rename to public/images/jquery.progressbar/progressbar.gif diff --git a/webui/images/jquery.progressbar/progressbg_black.gif b/public/images/jquery.progressbar/progressbg_black.gif similarity index 100% rename from webui/images/jquery.progressbar/progressbg_black.gif rename to public/images/jquery.progressbar/progressbg_black.gif diff --git a/webui/images/jquery.progressbar/progressbg_green.gif b/public/images/jquery.progressbar/progressbg_green.gif similarity index 100% rename from webui/images/jquery.progressbar/progressbg_green.gif rename to public/images/jquery.progressbar/progressbg_green.gif diff --git a/webui/images/jquery.progressbar/progressbg_orange.gif b/public/images/jquery.progressbar/progressbg_orange.gif similarity index 100% rename from webui/images/jquery.progressbar/progressbg_orange.gif rename to public/images/jquery.progressbar/progressbg_orange.gif diff --git a/webui/images/jquery.progressbar/progressbg_red.gif b/public/images/jquery.progressbar/progressbg_red.gif similarity index 100% rename from webui/images/jquery.progressbar/progressbg_red.gif rename to public/images/jquery.progressbar/progressbg_red.gif diff --git a/webui/images/jquery.progressbar/progressbg_yellow.gif b/public/images/jquery.progressbar/progressbg_yellow.gif similarity index 100% rename from webui/images/jquery.progressbar/progressbg_yellow.gif rename to public/images/jquery.progressbar/progressbg_yellow.gif diff --git a/webui/images/redo.png b/public/images/redo.png similarity index 100% rename from webui/images/redo.png rename to public/images/redo.png diff --git a/webui/images/trash.png b/public/images/trash.png similarity index 100% rename from webui/images/trash.png rename to public/images/trash.png diff --git a/webui/index.php b/public/index.php similarity index 100% rename from webui/index.php rename to public/index.php diff --git a/webui/run-jobs.php b/public/run-jobs.php similarity index 100% rename from webui/run-jobs.php rename to public/run-jobs.php diff --git a/webui/scripts/3rdparty/jquery.asmselect.js b/public/scripts/3rdparty/jquery.asmselect.js similarity index 100% rename from webui/scripts/3rdparty/jquery.asmselect.js rename to public/scripts/3rdparty/jquery.asmselect.js diff --git a/webui/scripts/3rdparty/jquery.jec-1.3.2.js b/public/scripts/3rdparty/jquery.jec-1.3.2.js similarity index 100% rename from webui/scripts/3rdparty/jquery.jec-1.3.2.js rename to public/scripts/3rdparty/jquery.jec-1.3.2.js diff --git a/webui/scripts/3rdparty/jquery.progressbar.min.js b/public/scripts/3rdparty/jquery.progressbar.min.js similarity index 100% rename from webui/scripts/3rdparty/jquery.progressbar.min.js rename to public/scripts/3rdparty/jquery.progressbar.min.js diff --git a/webui/scripts/main.js b/public/scripts/main.js similarity index 100% rename from webui/scripts/main.js rename to public/scripts/main.js diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png b/public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png rename to public/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png diff --git a/webui/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css b/public/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css similarity index 100% rename from webui/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css rename to public/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css diff --git a/webui/styles/3rdparty/jquery.asmselect.css b/public/styles/3rdparty/jquery.asmselect.css similarity index 100% rename from webui/styles/3rdparty/jquery.asmselect.css rename to public/styles/3rdparty/jquery.asmselect.css diff --git a/webui/styles/normal.css b/public/styles/normal.css similarity index 100% rename from webui/styles/normal.css rename to public/styles/normal.css diff --git a/source/lib/RippingCluster/Main.class.php b/source/lib/RippingCluster/Main.class.php index 18f8599..1bfb01e 100644 --- a/source/lib/RippingCluster/Main.class.php +++ b/source/lib/RippingCluster/Main.class.php @@ -4,6 +4,9 @@ require 'smarty/Smarty.class.php'; class RippingCluster_Main extends SihnonFramework_Main { + const TEMPLATE_DIR = '../source/webui/templates/'; + const CODE_DIR = '../source/webui/pages/'; + protected static $instance; protected $smarty; @@ -11,21 +14,25 @@ class RippingCluster_Main extends SihnonFramework_Main { protected function __construct() { parent::__construct(); + } + protected function init() { + parent::init(); + $request_string = isset($_GET['l']) ? $_GET['l'] : ''; - $this->request = new RippingCluster_RequestParser($request_string); - + $this->request = new RippingCluster_RequestParser($request_string, self::TEMPLATE_DIR, self::CODE_DIR); + switch (HBC_File) { case 'ajax': case 'index': { - $smarty_tmp = '/var/tmp/ripping-cluster'; + $smarty_tmp = $this->config->get('templates.tmp_path', '/var/tmp/ripping-cluster'); $this->smarty = new Smarty(); - $this->smarty->template_dir = static::makeAbsolutePath('./source/templates'); - $this->smarty->compile_dir = static::makeAbsolutePath($smarty_tmp . '/templates'); + $this->smarty->template_dir = static::makeAbsolutePath(self::TEMPLATE_DIR); + $this->smarty->compile_dir = static::makeAbsolutePath($smarty_tmp . '/templates'); $this->smarty->cache_dir = static::makeAbsolutePath($smarty_tmp . '/cache'); $this->smarty->config_dir = static::makeAbsolutePath($smarty_tmp . '/config'); - $this->smarty->plugins_dir[]= static::makeAbsolutePath('./source/smarty/plugins'); + $this->smarty->plugins_dir[]= static::makeAbsolutePath('../source/webui/smarty/plugins'); $this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration')); $this->smarty->registerPlugin('modifier', 'formatFilesize', array('RippingCluster_Main', 'formatFilesize')); diff --git a/webui/source/pages/admin/settings.php b/source/webui/pages/admin/settings.php similarity index 100% rename from webui/source/pages/admin/settings.php rename to source/webui/pages/admin/settings.php diff --git a/webui/source/pages/ajax/admin/add-setting.php b/source/webui/pages/ajax/admin/add-setting.php similarity index 100% rename from webui/source/pages/ajax/admin/add-setting.php rename to source/webui/pages/ajax/admin/add-setting.php diff --git a/webui/source/pages/ajax/admin/remove-setting.php b/source/webui/pages/ajax/admin/remove-setting.php similarity index 100% rename from webui/source/pages/ajax/admin/remove-setting.php rename to source/webui/pages/ajax/admin/remove-setting.php diff --git a/webui/source/pages/ajax/admin/rename-setting.php b/source/webui/pages/ajax/admin/rename-setting.php similarity index 100% rename from webui/source/pages/ajax/admin/rename-setting.php rename to source/webui/pages/ajax/admin/rename-setting.php diff --git a/webui/source/pages/ajax/delete-source.php b/source/webui/pages/ajax/delete-source.php similarity index 100% rename from webui/source/pages/ajax/delete-source.php rename to source/webui/pages/ajax/delete-source.php diff --git a/webui/source/pages/ajax/source-list.php b/source/webui/pages/ajax/source-list.php similarity index 100% rename from webui/source/pages/ajax/source-list.php rename to source/webui/pages/ajax/source-list.php diff --git a/webui/source/pages/ajax/update-settings.php b/source/webui/pages/ajax/update-settings.php similarity index 100% rename from webui/source/pages/ajax/update-settings.php rename to source/webui/pages/ajax/update-settings.php diff --git a/webui/source/pages/errors/404.php b/source/webui/pages/errors/404.php similarity index 100% rename from webui/source/pages/errors/404.php rename to source/webui/pages/errors/404.php diff --git a/webui/source/pages/errors/unhandled-exception.php b/source/webui/pages/errors/unhandled-exception.php similarity index 100% rename from webui/source/pages/errors/unhandled-exception.php rename to source/webui/pages/errors/unhandled-exception.php diff --git a/webui/source/pages/home.php b/source/webui/pages/home.php similarity index 100% rename from webui/source/pages/home.php rename to source/webui/pages/home.php diff --git a/webui/source/pages/jobs.php b/source/webui/pages/jobs.php similarity index 100% rename from webui/source/pages/jobs.php rename to source/webui/pages/jobs.php diff --git a/webui/source/pages/jobs/details.php b/source/webui/pages/jobs/details.php similarity index 100% rename from webui/source/pages/jobs/details.php rename to source/webui/pages/jobs/details.php diff --git a/webui/source/pages/logs.php b/source/webui/pages/logs.php similarity index 100% rename from webui/source/pages/logs.php rename to source/webui/pages/logs.php diff --git a/webui/source/pages/rips/setup.php b/source/webui/pages/rips/setup.php similarity index 100% rename from webui/source/pages/rips/setup.php rename to source/webui/pages/rips/setup.php diff --git a/webui/source/pages/sources/delete.php b/source/webui/pages/sources/delete.php similarity index 100% rename from webui/source/pages/sources/delete.php rename to source/webui/pages/sources/delete.php diff --git a/webui/source/pages/sources/details.php b/source/webui/pages/sources/details.php similarity index 100% rename from webui/source/pages/sources/details.php rename to source/webui/pages/sources/details.php diff --git a/webui/source/pages/sources/list.php b/source/webui/pages/sources/list.php similarity index 100% rename from webui/source/pages/sources/list.php rename to source/webui/pages/sources/list.php diff --git a/webui/source/smarty/plugins/compiler.switch.php b/source/webui/smarty/plugins/compiler.switch.php similarity index 100% rename from webui/source/smarty/plugins/compiler.switch.php rename to source/webui/smarty/plugins/compiler.switch.php diff --git a/webui/source/templates/admin/settings.tpl b/source/webui/templates/admin/settings.tpl similarity index 100% rename from webui/source/templates/admin/settings.tpl rename to source/webui/templates/admin/settings.tpl diff --git a/webui/source/templates/ajax.tpl b/source/webui/templates/ajax.tpl similarity index 100% rename from webui/source/templates/ajax.tpl rename to source/webui/templates/ajax.tpl diff --git a/webui/source/templates/ajax/admin/add-setting.tpl b/source/webui/templates/ajax/admin/add-setting.tpl similarity index 100% rename from webui/source/templates/ajax/admin/add-setting.tpl rename to source/webui/templates/ajax/admin/add-setting.tpl diff --git a/webui/source/templates/ajax/admin/new-setting.tpl b/source/webui/templates/ajax/admin/new-setting.tpl similarity index 100% rename from webui/source/templates/ajax/admin/new-setting.tpl rename to source/webui/templates/ajax/admin/new-setting.tpl diff --git a/webui/source/templates/ajax/admin/remove-setting.tpl b/source/webui/templates/ajax/admin/remove-setting.tpl similarity index 100% rename from webui/source/templates/ajax/admin/remove-setting.tpl rename to source/webui/templates/ajax/admin/remove-setting.tpl diff --git a/webui/source/templates/ajax/admin/rename-setting.tpl b/source/webui/templates/ajax/admin/rename-setting.tpl similarity index 100% rename from webui/source/templates/ajax/admin/rename-setting.tpl rename to source/webui/templates/ajax/admin/rename-setting.tpl diff --git a/webui/source/templates/ajax/delete-source.tpl b/source/webui/templates/ajax/delete-source.tpl similarity index 100% rename from webui/source/templates/ajax/delete-source.tpl rename to source/webui/templates/ajax/delete-source.tpl diff --git a/webui/source/templates/ajax/source-list.tpl b/source/webui/templates/ajax/source-list.tpl similarity index 100% rename from webui/source/templates/ajax/source-list.tpl rename to source/webui/templates/ajax/source-list.tpl diff --git a/webui/source/templates/ajax/update-settings.tpl b/source/webui/templates/ajax/update-settings.tpl similarity index 100% rename from webui/source/templates/ajax/update-settings.tpl rename to source/webui/templates/ajax/update-settings.tpl diff --git a/webui/source/templates/errors/404.tpl b/source/webui/templates/errors/404.tpl similarity index 100% rename from webui/source/templates/errors/404.tpl rename to source/webui/templates/errors/404.tpl diff --git a/webui/source/templates/errors/unhandled-exception.tpl b/source/webui/templates/errors/unhandled-exception.tpl similarity index 100% rename from webui/source/templates/errors/unhandled-exception.tpl rename to source/webui/templates/errors/unhandled-exception.tpl diff --git a/webui/source/templates/fragments/admin-setting-row.tpl b/source/webui/templates/fragments/admin-setting-row.tpl similarity index 100% rename from webui/source/templates/fragments/admin-setting-row.tpl rename to source/webui/templates/fragments/admin-setting-row.tpl diff --git a/webui/source/templates/fragments/admin-setting-value.tpl b/source/webui/templates/fragments/admin-setting-value.tpl similarity index 100% rename from webui/source/templates/fragments/admin-setting-value.tpl rename to source/webui/templates/fragments/admin-setting-value.tpl diff --git a/webui/source/templates/fragments/delete-source.tpl b/source/webui/templates/fragments/delete-source.tpl similarity index 100% rename from webui/source/templates/fragments/delete-source.tpl rename to source/webui/templates/fragments/delete-source.tpl diff --git a/webui/source/templates/fragments/messages.tpl b/source/webui/templates/fragments/messages.tpl similarity index 100% rename from webui/source/templates/fragments/messages.tpl rename to source/webui/templates/fragments/messages.tpl diff --git a/webui/source/templates/fragments/new-setting-dialog.tpl b/source/webui/templates/fragments/new-setting-dialog.tpl similarity index 100% rename from webui/source/templates/fragments/new-setting-dialog.tpl rename to source/webui/templates/fragments/new-setting-dialog.tpl diff --git a/webui/source/templates/fragments/rename-setting-dialog.tpl b/source/webui/templates/fragments/rename-setting-dialog.tpl similarity index 100% rename from webui/source/templates/fragments/rename-setting-dialog.tpl rename to source/webui/templates/fragments/rename-setting-dialog.tpl diff --git a/webui/source/templates/fragments/source-list.tpl b/source/webui/templates/fragments/source-list.tpl similarity index 100% rename from webui/source/templates/fragments/source-list.tpl rename to source/webui/templates/fragments/source-list.tpl diff --git a/webui/source/templates/fragments/update-settings-dialog.tpl b/source/webui/templates/fragments/update-settings-dialog.tpl similarity index 100% rename from webui/source/templates/fragments/update-settings-dialog.tpl rename to source/webui/templates/fragments/update-settings-dialog.tpl diff --git a/webui/source/templates/home.tpl b/source/webui/templates/home.tpl similarity index 100% rename from webui/source/templates/home.tpl rename to source/webui/templates/home.tpl diff --git a/webui/source/templates/index.tpl b/source/webui/templates/index.tpl similarity index 100% rename from webui/source/templates/index.tpl rename to source/webui/templates/index.tpl diff --git a/webui/source/templates/jobs.tpl b/source/webui/templates/jobs.tpl similarity index 100% rename from webui/source/templates/jobs.tpl rename to source/webui/templates/jobs.tpl diff --git a/webui/source/templates/jobs/details.tpl b/source/webui/templates/jobs/details.tpl similarity index 100% rename from webui/source/templates/jobs/details.tpl rename to source/webui/templates/jobs/details.tpl diff --git a/webui/source/templates/logs.tpl b/source/webui/templates/logs.tpl similarity index 100% rename from webui/source/templates/logs.tpl rename to source/webui/templates/logs.tpl diff --git a/webui/source/templates/navigation.tpl b/source/webui/templates/navigation.tpl similarity index 100% rename from webui/source/templates/navigation.tpl rename to source/webui/templates/navigation.tpl diff --git a/webui/source/templates/rips/setup.tpl b/source/webui/templates/rips/setup.tpl similarity index 100% rename from webui/source/templates/rips/setup.tpl rename to source/webui/templates/rips/setup.tpl diff --git a/webui/source/templates/sidebar.tpl b/source/webui/templates/sidebar.tpl similarity index 100% rename from webui/source/templates/sidebar.tpl rename to source/webui/templates/sidebar.tpl diff --git a/webui/source/templates/sources/delete.tpl b/source/webui/templates/sources/delete.tpl similarity index 100% rename from webui/source/templates/sources/delete.tpl rename to source/webui/templates/sources/delete.tpl diff --git a/webui/source/templates/sources/details.tpl b/source/webui/templates/sources/details.tpl similarity index 100% rename from webui/source/templates/sources/details.tpl rename to source/webui/templates/sources/details.tpl diff --git a/webui/source/templates/sources/list.tpl b/source/webui/templates/sources/list.tpl similarity index 100% rename from webui/source/templates/sources/list.tpl rename to source/webui/templates/sources/list.tpl diff --git a/worker/ripping-cluster-worker.php b/source/worker/ripping-cluster-worker.php similarity index 100% rename from worker/ripping-cluster-worker.php rename to source/worker/ripping-cluster-worker.php From a6ddb25eae43914d59305397baa890061b11821c Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Wed, 11 Jan 2012 00:48:46 +0000 Subject: [PATCH 02/10] Bootstrapify the webui --- public/scripts/3rdparty/bootstrap-alerts.js | 113 ++++++ public/scripts/3rdparty/bootstrap-dropdown.js | 55 +++ public/scripts/3rdparty/bootstrap-modal.js | 260 ++++++++++++++ public/scripts/3rdparty/bootstrap-popover.js | 90 +++++ public/scripts/3rdparty/bootstrap-tabs.js | 80 +++++ public/scripts/3rdparty/bootstrap-twipsy.js | 321 ++++++++++++++++++ public/scripts/3rdparty/jquery.chained.js | 73 ++++ public/scripts/3rdparty/less-1.1.5.min.js | 16 + public/scripts/main.js | 17 +- public/styles/normal.css | 298 ++++++---------- source/lib/RippingCluster/Main.class.php | 3 +- {public => source/webui}/run-jobs.php | 0 source/webui/templates/home.tpl | 18 - source/webui/templates/index.tpl | 123 ++++--- source/webui/templates/navigation.tpl | 34 +- 15 files changed, 1250 insertions(+), 251 deletions(-) create mode 100644 public/scripts/3rdparty/bootstrap-alerts.js create mode 100644 public/scripts/3rdparty/bootstrap-dropdown.js create mode 100644 public/scripts/3rdparty/bootstrap-modal.js create mode 100644 public/scripts/3rdparty/bootstrap-popover.js create mode 100644 public/scripts/3rdparty/bootstrap-tabs.js create mode 100644 public/scripts/3rdparty/bootstrap-twipsy.js create mode 100644 public/scripts/3rdparty/jquery.chained.js create mode 100644 public/scripts/3rdparty/less-1.1.5.min.js rename {public => source/webui}/run-jobs.php (100%) diff --git a/public/scripts/3rdparty/bootstrap-alerts.js b/public/scripts/3rdparty/bootstrap-alerts.js new file mode 100644 index 0000000..37bb430 --- /dev/null +++ b/public/scripts/3rdparty/bootstrap-alerts.js @@ -0,0 +1,113 @@ +/* ========================================================== + * bootstrap-alerts.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2011 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function( $ ){ + + "use strict" + + /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) + * ======================================================= */ + + var transitionEnd + + $(document).ready(function () { + + $.support.transition = (function () { + var thisBody = document.body || document.documentElement + , thisStyle = thisBody.style + , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined + return support + })() + + // set CSS transition event type + if ( $.support.transition ) { + transitionEnd = "TransitionEnd" + if ( $.browser.webkit ) { + transitionEnd = "webkitTransitionEnd" + } else if ( $.browser.mozilla ) { + transitionEnd = "transitionend" + } else if ( $.browser.opera ) { + transitionEnd = "oTransitionEnd" + } + } + + }) + + /* ALERT CLASS DEFINITION + * ====================== */ + + var Alert = function ( content, options ) { + this.settings = $.extend({}, $.fn.alert.defaults, options) + this.$element = $(content) + .delegate(this.settings.selector, 'click', this.close) + } + + Alert.prototype = { + + close: function (e) { + var $element = $(this).parent('.alert-message') + + e && e.preventDefault() + $element.removeClass('in') + + function removeElement () { + $element.remove() + } + + $.support.transition && $element.hasClass('fade') ? + $element.bind(transitionEnd, removeElement) : + removeElement() + } + + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + $.fn.alert = function ( options ) { + + if ( options === true ) { + return this.data('alert') + } + + return this.each(function () { + var $this = $(this) + + if ( typeof options == 'string' ) { + return $this.data('alert')[options]() + } + + $(this).data('alert', new Alert( this, options )) + + }) + } + + $.fn.alert.defaults = { + selector: '.close' + } + + $(document).ready(function () { + new Alert($('body'), { + selector: '.alert-message[data-alert] .close' + }) + }) + +}( window.jQuery || window.ender ); \ No newline at end of file diff --git a/public/scripts/3rdparty/bootstrap-dropdown.js b/public/scripts/3rdparty/bootstrap-dropdown.js new file mode 100644 index 0000000..cab0ec2 --- /dev/null +++ b/public/scripts/3rdparty/bootstrap-dropdown.js @@ -0,0 +1,55 @@ +/* ============================================================ + * bootstrap-dropdown.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#dropdown + * ============================================================ + * Copyright 2011 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function( $ ){ + + "use strict" + + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ + + $.fn.dropdown = function ( selector ) { + return this.each(function () { + $(this).delegate(selector || d, 'click', function (e) { + var li = $(this).parent('li') + , isActive = li.hasClass('open') + + clearMenus() + !isActive && li.toggleClass('open') + return false + }) + }) + } + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + var d = 'a.menu, .dropdown-toggle' + + function clearMenus() { + $(d).parent('li').removeClass('open') + } + + $(function () { + $('html').bind("click", clearMenus) + $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' ) + }) + +}( window.jQuery || window.ender ); \ No newline at end of file diff --git a/public/scripts/3rdparty/bootstrap-modal.js b/public/scripts/3rdparty/bootstrap-modal.js new file mode 100644 index 0000000..be2315a --- /dev/null +++ b/public/scripts/3rdparty/bootstrap-modal.js @@ -0,0 +1,260 @@ +/* ========================================================= + * bootstrap-modal.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#modal + * ========================================================= + * Copyright 2011 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= */ + + +!function( $ ){ + + "use strict" + + /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) + * ======================================================= */ + + var transitionEnd + + $(document).ready(function () { + + $.support.transition = (function () { + var thisBody = document.body || document.documentElement + , thisStyle = thisBody.style + , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined + return support + })() + + // set CSS transition event type + if ( $.support.transition ) { + transitionEnd = "TransitionEnd" + if ( $.browser.webkit ) { + transitionEnd = "webkitTransitionEnd" + } else if ( $.browser.mozilla ) { + transitionEnd = "transitionend" + } else if ( $.browser.opera ) { + transitionEnd = "oTransitionEnd" + } + } + + }) + + + /* MODAL PUBLIC CLASS DEFINITION + * ============================= */ + + var Modal = function ( content, options ) { + this.settings = $.extend({}, $.fn.modal.defaults, options) + this.$element = $(content) + .delegate('.close', 'click.modal', $.proxy(this.hide, this)) + + if ( this.settings.show ) { + this.show() + } + + return this + } + + Modal.prototype = { + + toggle: function () { + return this[!this.isShown ? 'show' : 'hide']() + } + + , show: function () { + var that = this + this.isShown = true + this.$element.trigger('show') + + escape.call(this) + backdrop.call(this, function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + that.$element + .appendTo(document.body) + .show() + + if (transition) { + that.$element[0].offsetWidth // force reflow + } + + that.$element.addClass('in') + + transition ? + that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) : + that.$element.trigger('shown') + + }) + + return this + } + + , hide: function (e) { + e && e.preventDefault() + + if ( !this.isShown ) { + return this + } + + var that = this + this.isShown = false + + escape.call(this) + + this.$element + .trigger('hide') + .removeClass('in') + + $.support.transition && this.$element.hasClass('fade') ? + hideWithTransition.call(this) : + hideModal.call(this) + + return this + } + + } + + + /* MODAL PRIVATE METHODS + * ===================== */ + + function hideWithTransition() { + // firefox drops transitionEnd events :{o + var that = this + , timeout = setTimeout(function () { + that.$element.unbind(transitionEnd) + hideModal.call(that) + }, 500) + + this.$element.one(transitionEnd, function () { + clearTimeout(timeout) + hideModal.call(that) + }) + } + + function hideModal (that) { + this.$element + .hide() + .trigger('hidden') + + backdrop.call(this) + } + + function backdrop ( callback ) { + var that = this + , animate = this.$element.hasClass('fade') ? 'fade' : '' + if ( this.isShown && this.settings.backdrop ) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $('