Author: thaberkern
Date: 2010-01-12 11:21:14 +0100 (Tue, 12 Jan 2010)
New Revision: 26521
Modified:
plugins/sfAmfPlugin/README
plugins/sfAmfPlugin/lib/adapter/DoctrineCollectionAdapter.php
plugins/sfAmfPlugin/lib/adapter/DoctrineRecordAdapter.php
plugins/sfAmfPlugin/lib/adapter/sfAdapterBase.php
plugins/sfAmfPlugin/lib/sfAmfTreeViewer.php
plugins/sfAmfPlugin/modules/amfbrowser/actions/actions.class.php
plugins/sfAmfPlugin/modules/amfbrowser/templates/indexSuccess.php
plugins/sfAmfPlugin/web/css/sfAmfPluginBrowser.css
Log:
[sfAmfPlugin] Fixed Tyops, Small refactorings, Improved look&feel of
Service-Browser, Fixed Bug in Service-Browser and DateTime
Modified: plugins/sfAmfPlugin/README
===================================================================
--- plugins/sfAmfPlugin/README 2010-01-12 10:16:48 UTC (rev 26520)
+++ plugins/sfAmfPlugin/README 2010-01-12 10:21:14 UTC (rev 26521)
@@ -231,10 +231,15 @@
Changelog
---------
+ * 1.5.1 (01-11-2010)
+ * Fixed bug with DateTime handling of objects in Service-Browser
+ * Improved Look and feel of the Service browser
+ * Fixed typos in sfAdapterBase
+ * Improved documentation
* 1.5.0 (01-11-2010)
* Added Support for Symfony 1.3 and 1.4
* Updated to most current development version of SabreAMF
- * Added first version of an AMF service browser (thanks to Beno�t
Gouchet)
+ * Added first version of an AMF service browser (thanks to Benoit
Guchet)
* 1.4.2 (08-05-2009)
* Changed error_handler behaviour
* Improved Doctrine Adapters, so they handle relations better
Modified: plugins/sfAmfPlugin/lib/adapter/DoctrineCollectionAdapter.php
===================================================================
--- plugins/sfAmfPlugin/lib/adapter/DoctrineCollectionAdapter.php
2010-01-12 10:16:48 UTC (rev 26520)
+++ plugins/sfAmfPlugin/lib/adapter/DoctrineCollectionAdapter.php
2010-01-12 10:21:14 UTC (rev 26521)
@@ -9,7 +9,7 @@
class DoctrineCollectionAdapter extends sfAdapterBase {
- public static function getInsatnce() {
+ public static function getInstance() {
return new DoctrineCollectionAdapter();
}
Modified: plugins/sfAmfPlugin/lib/adapter/DoctrineRecordAdapter.php
===================================================================
--- plugins/sfAmfPlugin/lib/adapter/DoctrineRecordAdapter.php 2010-01-12
10:16:48 UTC (rev 26520)
+++ plugins/sfAmfPlugin/lib/adapter/DoctrineRecordAdapter.php 2010-01-12
10:21:14 UTC (rev 26521)
@@ -21,7 +21,7 @@
if (!array_key_exists($cn, $columns)) {
if ($data->$cn instanceof Doctrine_Collection ) {
- $result->$cn =
DoctrineCollectionAdapter::getInsatnce()->run($data->$cn);
+ $result->$cn =
DoctrineCollectionAdapter::getInstance()->run($data->$cn);
}
else {
$result->$cn = $this->run($data->$cn);
Modified: plugins/sfAmfPlugin/lib/adapter/sfAdapterBase.php
===================================================================
--- plugins/sfAmfPlugin/lib/adapter/sfAdapterBase.php 2010-01-12 10:16:48 UTC
(rev 26520)
+++ plugins/sfAmfPlugin/lib/adapter/sfAdapterBase.php 2010-01-12 10:21:14 UTC
(rev 26521)
@@ -8,43 +8,50 @@
*/
abstract class sfAdapterBase {
- public abstract function run($data);
-
- protected function to_string($val) {
- return (string)$val;
- }
-
- protected function to_varchar($val) {
- return (string)$val;
- }
-
- protected function to_boolean($val) {
- return $val === 1 ? TRUE : FALSE;
- }
-
- protected function to_integer($val) {
- return intval($val);
- }
-
- protected function to_decimal($val) {
- return floatval($val);
- }
-
- protected function to_float($val) {
- return floatval($val);
- }
-
- protected function to_timestamp($val) {
- return date_create($val);
- }
-
- protected function to_time($val) {
- return date_create($val);
- }
-
- protected function to_date($val) {
- return date_create($val);
- }
-
+ public abstract function run($data);
+
+ protected function to_string($value) {
+ return (string)$value;
+ }
+
+ protected function to_varchar($value) {
+ return (string)$value;
+ }
+
+ protected function to_boolean($value) {
+ return $value === 1 ? TRUE : FALSE;
+ }
+
+ protected function to_integer($value) {
+ return intval($value);
+ }
+
+ protected function to_decimal($value) {
+ return floatval($value);
+ }
+
+ protected function to_float($value) {
+ return floatval($value);
+ }
+
+ protected function to_timestamp($value) {
+ return $this->createDateTimeObject($value);
+ }
+
+ protected function to_time($value) {
+ return $this->createDateTimeObject($value);
+ }
+
+ protected function to_date($value) {
+ return $this->createDateTimeObject($value);
+ }
+
+
+ protected function createDateTimeObject($value) {
+ if ($value != '') {
+ return date_create($value);
+ }
+ return null;
+ }
}
?>
\ No newline at end of file
Modified: plugins/sfAmfPlugin/lib/sfAmfTreeViewer.php
===================================================================
--- plugins/sfAmfPlugin/lib/sfAmfTreeViewer.php 2010-01-12 10:16:48 UTC (rev
26520)
+++ plugins/sfAmfPlugin/lib/sfAmfTreeViewer.php 2010-01-12 10:21:14 UTC (rev
26521)
@@ -27,10 +27,11 @@
foreach ($array as $child_key => $child_value)
$str .= self::display($child_key, $child_value, $level + 1);
}
+ else if ($type == 'object' && get_class($value) == 'DateTime') {
+ $str .= '<td class="value">'.date_format($value, 'm-d-Y
H:i:s').'</td></tr>';
+ }
else {
- $str .= '
- <td class="value">'.$value.'</td>
- </tr>';
+ $str .= '<td class="value">'.$value.'</td></tr>';
}
return $str;
Modified: plugins/sfAmfPlugin/modules/amfbrowser/actions/actions.class.php
===================================================================
--- plugins/sfAmfPlugin/modules/amfbrowser/actions/actions.class.php
2010-01-12 10:16:48 UTC (rev 26520)
+++ plugins/sfAmfPlugin/modules/amfbrowser/actions/actions.class.php
2010-01-12 10:21:14 UTC (rev 26521)
@@ -88,6 +88,7 @@
* @return <type>
*/
protected function _makeAmfResponseFromMethodReturn($method_return) {
+
$response = new SabreAMF_AMF3_AcknowledgeMessage();
$response->body = $method_return;
Modified: plugins/sfAmfPlugin/modules/amfbrowser/templates/indexSuccess.php
===================================================================
--- plugins/sfAmfPlugin/modules/amfbrowser/templates/indexSuccess.php
2010-01-12 10:16:48 UTC (rev 26520)
+++ plugins/sfAmfPlugin/modules/amfbrowser/templates/indexSuccess.php
2010-01-12 10:21:14 UTC (rev 26521)
@@ -6,53 +6,39 @@
<script type="text/javascript" src="<?php
use_javascript('/sfAmfPlugin/js/mootools-more.js') ?>"></script>
<script type="text/javascript" src="<?php
use_javascript('/sfAmfPlugin/js/sfAmfPluginBrowser.js') ?>"></script>
<link rel="shortcut icon" href="/favicon.ico" />
- <script type="text/javascript">
-
- </script>
</head>
<body>
<div id="global">
<div class="methods">
<h2>Service-Classes:</h2>
-<?php
- $request = sfContext::getInstance()->getRequest();
-
- foreach ($services_reflections as $package_name=>$class)
- {
-?>
- <div class="service<?php echo $class->getName() == $service_name ? '
active' : ' is_fold' ?>">
+ <div id="outer">
+<?php foreach ($services_reflections as $package_name=>$class): ?>
+ <div class="inner service<?php echo $class->getName() == $service_name ? '
active' : ' is_fold' ?>">
<h3>
<a href="#"
onclick="$(this).getParent().getParent().toggleClass('is_fold')">+</a>
<?php echo $class->getName() ?>
</h3>
<ul>
-<?php
+ <?php $is_empty = true; ?>
+ <?php foreach ($class->getMethods() as $method): ?>
+
+ <?php if (!$method->isPublic() or $method->getDeclaringClass() !=
$class) continue;?>
- $is_empty = true;
- foreach ($class->getMethods() as $method)
- {
- if (!$method->isPublic() or $method->getDeclaringClass() != $class)
- continue;
+ <?php $is_empty = false; ?>
+ <li class="method"><?php echo link_to($method->getName(),
'amfBrowser/index?method='.urlencode($package_name.'::'.$method->getName()));?></li>
+ <?php endforeach;?>
- $is_empty = false;
- echo '<li class="method">'.link_to($method->getName(),
'amfBrowser/index?method='.urlencode($package_name.'::'.$method->getName())).'</li>';
- }
-
- if ($is_empty)
- echo '<li class="no_methods">No callable methods</li>';
-?>
+ <?php if ($is_empty):?>
+ <li class="no_methods">No callable methods</li>
+ <?php endif; ?>
</ul>
</div>
-<?php
- }
-?>
+<?php endforeach;?>
+ </div>
</div>
<div id="right">
-<?php
- if ($service_method_name)
- {
-?>
+<?php if ($service_method_name): ?>
<div>
<h3>Request: </h3>
<h4><?php echo $service_method_name ?></h4>
@@ -60,11 +46,8 @@
<form action="" method="post">
<input type="hidden" name="method" value="<?php echo
$service_method_name ?>" />
<ul>
-<?php
- foreach ($method_reflection->getParameters() as $param)
- {
- $input_name = 'param['.$param->getName().']';
-?>
+ <?php foreach ($method_reflection->getParameters() as $param): ?>
+ <?php $input_name = 'param['.$param->getName().']'; ?>
<li>
<label>
<?php echo $param->getName() ?> :
@@ -72,20 +55,19 @@
value="<?php echo
htmlspecialchars($sf_request->getParameter($input_name)) ?>" />
</label>
</li>
-<?php
- }
-?>
+ <?php endforeach; ?>
</ul>
<input class="submit" type="submit" value="Call" />
</form>
</div>
<hr />
-<?php
- }
+<?php endif;?>
+
- foreach ($errors as $err)
- echo '<p style="color:red; font-weight:bold; font-size: 120%; ">/!\
'.$err.'</p>';
-?>
+<?php foreach ($errors as $err): ?>
+ <p style="color:red; font-weight:bold; font-size: 120%;">! <?php echo
$err;?></p>
+<?php endforeach; ?>
+
<div class="response">
<h3>Response:</h3>
<ul class="result_views_menu">
Modified: plugins/sfAmfPlugin/web/css/sfAmfPluginBrowser.css
===================================================================
--- plugins/sfAmfPlugin/web/css/sfAmfPluginBrowser.css 2010-01-12 10:16:48 UTC
(rev 26520)
+++ plugins/sfAmfPlugin/web/css/sfAmfPluginBrowser.css 2010-01-12 10:21:14 UTC
(rev 26521)
@@ -17,13 +17,51 @@
dfn { font-size:10px; color: gray;}
-.methods {float: left; width: 30%; background-color: #fff9e0; margin-right:
10px; }
-.methods ul li {list-style-type: disc; margin-left:40px; font-size: 9pt }
+.methods {float: left; width: 30%; background-color: #e3e3e3;
+ border: 1px solid #e3e3e3;
+ margin-bottom: 15px;
+ -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;
+ margin-right: 10px;
+ background-color: #fef2c9;
+}
-.service { border: 1px solid silver }
+.methods h2
+{
+ color: #858585;
+ margin: 0;
+ padding: 0;
+ padding: 5px 10px;
+ font-size: 1em;
+}
+.methods h3
+{
+ color: #858585;
+ margin: 0;
+ padding: 0;
+ padding: 5px 10px;
+ font-size: 1em;
+}
+
+.methods #outer
+{
+ padding: 10px 15px;
+}
+
+.methods .inner {
+ padding: 4px;
+}
+
+.methods ul li {list-style-type: none; margin-left:40px; font-size: 9pt }
+
+.methods h3 a { text-decoration: none }
+
+.service { background: #DFDFDF }
+
.service.is_fold ul {display: none;}
+.methods .active { background: #EFEFEF; }
+
.tree_view ul li {margin-left:10px;}
table.tree_view {width:800px;}
@@ -37,4 +75,5 @@
.response ul.result_views_menu li {float:left; margin-right: 10px;}
.response ul.result_views_menu li.selected a { font-weight: bold; }
.response .result_view {display:none}
-.response .result_view.selected {display:block}
\ No newline at end of file
+.response .result_view.selected {display:block}
+
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.