--- FreeBSD/tinderbox/webui/module/moduleConfig.php 2007/11/02 20:55:00 1.1.1.1 +++ FreeBSD/tinderbox/webui/module/moduleConfig.php 2007/11/13 07:36:19 1.1.1.1.2.1 @@ -24,20 +24,20 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # +# $Paefchen$ # $MCom: portstools/tinderbox/webui/module/moduleConfig.php,v 1.4 2007/10/13 02:28:47 ade Exp $ # -require_once 'module/module.php'; -require_once 'module/moduleUsers.php'; - class moduleConfig extends module { + private $moduleUsers = null; - function moduleConfig() { + public function moduleConfig() { + parent::__construct(); $this->module(); - $this->moduleUsers = new moduleUsers(); + $this->moduleUsers = new moduleUsers; } - function _array_sort_and_assign( $sort_me, $tpl_key ) { + private function _array_sort_and_assign( $sort_me, $tpl_key ) { if( is_array( $sort_me ) && count( $sort_me ) > 0 ) { foreach( $sort_me as $res ) $sort[] = $res[$tpl_key.'_name']; @@ -49,7 +49,7 @@ class moduleConfig extends module { } } - function display_config() { + public function display_config() { if( !$this->moduleUsers->is_logged_in() ) { return $this->template_parse( 'please_login.tpl' ); } else if( ! $this->moduleUsers->checkWwwAdmin() ) { @@ -70,7 +70,7 @@ class moduleConfig extends module { 'jail_update_cmd' => $jail->getUpdateCmd(), 'jail_description' => $jail->getDescription(), 'jail_src_mount' => $jail->getSrcMount() ); - }; + } foreach( $ports_trees as $ports_tree ) { $ports_tree_id = $ports_tree->getId(); @@ -80,7 +80,7 @@ class moduleConfig extends module { 'ports_tree_description' => $ports_tree->getDescription(), 'ports_tree_cvsweb_url' => $ports_tree->getCVSwebURL(), 'ports_tree_ports_mount' => $ports_tree->getPortsMount() ); - }; + } foreach( $builds as $build ) { $build_id = $build->getId(); @@ -88,12 +88,12 @@ class moduleConfig extends module { 'build_description' => $build->getDescription(), 'jail_name' => $all_jails[$build->getJailId()]['jail_name'], 'ports_tree_name' => $all_ports_trees[$build->getPortsTreeId()]['ports_tree_name'] ); - }; + } foreach( $config_options as $config_option ) { $all_config_options[] = array( 'config_option_name' => $config_option->getName(), 'config_option_value' => $config_option->getValue() ); - }; + } $this->_array_sort_and_assign( $all_jails, 'jail' ); $this->_array_sort_and_assign( $all_ports_trees, 'ports_tree' ); @@ -102,6 +102,6 @@ class moduleConfig extends module { return $this->template_parse( 'config.tpl' ); } - } + ?>