svn: /pear2/sandbox/Pyrus_WebFrontend/trunk/ src/pear2/Pyrus/WebFrontend/Controller.php src/pear2/Pyrus/WebFrontend/EditConfiguration.php
www/templates/WebFrontend/Controller.tpl.php www/templates/WebFrontend/EditConfiguration.tpl.php

From: Date: Tue, 23 Mar 2010 17:09:46 +0000
Subject: svn: /pear2/sandbox/Pyrus_WebFrontend/trunk/ src/pear2/Pyrus/WebFrontend/Controller.php src/pear2/Pyrus/WebFrontend/EditConfiguration.php
www/templates/WebFrontend/Controller.tpl.php www/templates/WebFrontend/EditConfiguration.tpl.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9325@lists.php.net to get a copy of this message
saltybeagle Tue, 23 Mar 2010 17:09:46 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=296682 Log: Add view for modifying the pyrus configuration. Data still needs to be saved once submitted. Changed paths: U pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php A pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/EditConfiguration.php U pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/Controller.tpl.php A pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/EditConfiguration.tpl.php Modified: pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php =================================================================== --- pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php 2010-03-23 16:47:44 UTC (rev 296681) +++ pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php 2010-03-23 17:09:46 UTC (rev 296682) @@ -28,6 +28,7 @@ { public $view_map = array( 'index' => 'pear2\Pyrus\WebFrontend\Index', + 'config' => 'pear2\Pyrus\WebFrontend\EditConfiguration', 'discoverchannel' => 'pear2\Pyrus\WebFrontend\DiscoverChannel', 'list_channels' => 'pear2\Pyrus\WebFrontend\ListChannels', 'list_packages' => 'pear2\Pyrus\WebFrontend\ListPackages', Added: pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/EditConfiguration.php =================================================================== --- pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/EditConfiguration.php (rev 0) +++ pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/EditConfiguration.php 2010-03-23 17:09:46 UTC (rev 296682) @@ -0,0 +1,27 @@ +<?php +namespace pear2\Pyrus\WebFrontend; +class EditConfiguration +{ + protected $config; + + function __construct($options = array()) + { + if (isset($_POST)) { + $this->handlePost(); + } + $this->config = Controller::getConfig(); + } + + function handlePost() + { + if (isset($_POST['_type'], $_POST['config']) + && is_array($_POST['config'])) { + // OK + } + } + + function __get($var) + { + return $this->config->$var; + } +} \ No newline at end of file Modified: pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/Controller.tpl.php =================================================================== --- pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/Controller.tpl.php 2010-03-23 16:47:44 UTC (rev 296681) +++ pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/Controller.tpl.php 2010-03-23 17:09:46 UTC (rev 296682) @@ -9,6 +9,7 @@ <li><a href="?view=list_channels">List Channels</a></li> <li><a href="?view=install">Install/Upgrade</a></li> <li><a href="?view=discoverchannel">Add Channel</a></li> + <li><a href="?view=config">Edit Configuration</a></li> </ul> <?php echo $savant->render($context->actionable); ?> </body> \ No newline at end of file Added: pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/EditConfiguration.tpl.php =================================================================== --- pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/EditConfiguration.tpl.php (rev 0) +++ pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/EditConfiguration.tpl.php 2010-03-23 17:09:46 UTC (rev 296682) @@ -0,0 +1,51 @@ +<h2>Edit Configuration</h2> +<form method="post" action="?view=config"> + <fieldset> + <legend>System paths:</legend> + <?php + foreach ($context->mainsystemvars as $var) { + echo "<label>$var:</label><input name=\"$var\" type=\"text\" value=\"{$context->$var}\" /><br />\n"; + } + ?> + </fieldset> + <fieldset> + <legend>Custom System paths:</legend> + <?php + foreach ($context->customsystemvars as $var) { + echo "<label>$var:</label><input name=\"$var\" type=\"text\" value=\"{$context->$var}\" /><br />\n"; + } + ?> + </fieldset> + <fieldset> + <legend>User config (from <?php echo $context->userfile; ?>):</legend> + <?php + foreach ($context->mainuservars as $var) { + echo "<label>$var:</label><input name=\"$var\" type=\"text\" value=\"{$context->$var}\" /><br />\n"; + } + ?> + </fieldset> + <fieldset> + <legend>(variables specific to <?php echo $context->default_channel; ?>):</legend> + <?php + foreach ($context->mainchannelvars as $var) { + echo "<label>$var:</label><input name=\"$var\" type=\"text\" value=\"{$context->$var}\" /><br />\n"; + } + ?> + </fieldset> + <fieldset> + <legend>Custom User config (from <?php echo $context->userfile; ?>):</legend> + <?php + foreach ($context->customuservars as $var) { + echo "<label>$var:</label><input name=\"$var\" type=\"text\" value=\"{$context->$var}\" /><br />\n"; + } + ?> + </fieldset> + <fieldset> + <legend>(variables specific to <?php echo $context->default_channel; ?>):</legend> + <?php + foreach ($context->customchannelvars as $var) { + echo "<label>$var:</label><input name=\"$var\" type=\"text\" value=\"{$context->$var}\" /><br />\n"; + } + ?> + </fieldset> +</form> \ No newline at end of file

« previous php.pear.core (#9325) next »