Skip to content

Commit

Permalink
Issue #12 : Edit data, GET - SET
Browse files Browse the repository at this point in the history
  • Loading branch information
ukko committed Mar 13, 2012
1 parent e8f1a0b commit 03b0e5e
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 482 deletions.
5 changes: 5 additions & 0 deletions application/classes/Command/Strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ public function get( $key )
{
return R::factory()->get( $key );
}

public function set( $key, $value )
{
return R::factory()->set( $key, $value );
}
}
11 changes: 11 additions & 0 deletions application/classes/Controller/CommandRaw.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,16 @@ public function get( $key )
return Command_Strings::get( $key );
}

public function set( $args )
{
$args = explode( ' ', $args, 2 );
if ( count($args) >= 2 )
{
$key = $args[0];
$data = $args[1];
}

Command_Strings::set( $key, $data );
return htmlspecialchars( $data );
}
}
2 changes: 1 addition & 1 deletion application/classes/Controller/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function executeCommand()
else
{
$method = Request::factory()->getCmd();
$args = array();
$args = substr( Request::factory()->getCmd(), $pos + 1 );
}

if ( Request::factory()->getFormat() == Request::FORMAT_RAW )
Expand Down
4 changes: 2 additions & 2 deletions application/classes/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ private function before()

if ( isset( $_POST['cmd'] ) )
{
$this->setCmd( filter_input( INPUT_POST, 'cmd', FILTER_SANITIZE_STRING ) );
$this->setCmd( filter_input( INPUT_POST, 'cmd' ) );
}
else
{
$this->setCmd( filter_input( INPUT_GET, 'cmd', FILTER_SANITIZE_STRING ) );
$this->setCmd( filter_input( INPUT_GET, 'cmd' ) );
}

if ( isset( $_POST['db'] ) )
Expand Down
2 changes: 0 additions & 2 deletions application/view/head.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
<script src="/js/bootstrap-button.js"></script>
<script src="/js/jquery.history.js"></script>
<script src="/js/jquery.jeditable.js"></script>
<script src="/js/jquery.autogrow.js"></script>
<script src="/js/jquery.jeditable.autogrow.js"></script>
<script src="/js/jquery-ui-1.8.17.custom.min.js"></script>
Expand Down
11 changes: 5 additions & 6 deletions application/view/tables/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
<tbody>
<tr>
<td>
<div class="span9 overflow edit"
cmd="<?php echo $key ?>"
data-key="<?php echo htmlspecialchars($key, ENT_QUOTES) ?>"
data-load="/?db=0&format=raw&cmd=GET+test.s"
data-save="/?db=0&cmd=SET+test.s">
<div class="span9 overflow textarea"
data-cmd="SET <?php echo $key ?> "
data-load="<?php echo '/?db=' . Request::factory()->getDb() . '&format=raw&cmd=GET+' . $key ?>"
data-save="<?php echo '/?db=' . Request::factory()->getDb() . '&format=raw' ?>">
<?php echo htmlspecialchars($value, ENT_QUOTES) ?>
</div>
</td>
<td>
<div class="btn-group">
<a class="btn " data-toggle="dropdown" href="#">
<a class="btn textarea" data-toggle="dropdown" href="#">
<i class="icon-pencil"></i>
</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
Expand Down
38 changes: 0 additions & 38 deletions www/js/jquery.jeditable.autogrow.js

This file was deleted.

Loading

0 comments on commit 03b0e5e

Please sign in to comment.