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