Permalink
Browse files

First commit

  • Loading branch information...
0 parents commit c56bee5022a9b2c6f7e47a5f5a8de38efc20b572 @tonydspaniard committed Dec 4, 2011
Showing with 18,686 additions and 0 deletions.
  1. +55 −0 behaviors/EDateFormatBehavior/EDateFormatBehavior.php
  2. +38 −0 behaviors/EJsonBehavior/EJsonBehavior.php
  3. +465 −0 extensions/EFeed/EFeed.php
  4. +137 −0 extensions/EFeed/EFeedItemAbstract.php
  5. +121 −0 extensions/EFeed/EFeedItemAtom.php
  6. +108 −0 extensions/EFeed/EFeedItemRSS1.php
  7. +119 −0 extensions/EFeed/EFeedItemRSS2.php
  8. +58 −0 extensions/EFeed/EFeedTag.php
  9. +1,254 −0 extensions/EGMap/EGMap.php
  10. +98 −0 extensions/EGMap/EGMapApiKeyList.php
  11. +134 −0 extensions/EGMap/EGMapBase.php
  12. +439 −0 extensions/EGMap/EGMapBounds.php
  13. +256 −0 extensions/EGMap/EGMapClient.php
  14. +42 −0 extensions/EGMap/EGMapControlPosition.php
  15. +429 −0 extensions/EGMap/EGMapCoord.php
  16. +177 −0 extensions/EGMap/EGMapDirection.php
  17. +123 −0 extensions/EGMap/EGMapDirectionRenderer.php
  18. +117 −0 extensions/EGMap/EGMapDirectionWayPoint.php
  19. +154 −0 extensions/EGMap/EGMapEvent.php
  20. +303 −0 extensions/EGMap/EGMapGeocodeTool.php
  21. +341 −0 extensions/EGMap/EGMapGeocodedAddress.php
  22. +144 −0 extensions/EGMap/EGMapInfoBox.php
  23. +257 −0 extensions/EGMap/EGMapInfoWindow.php
  24. +52 −0 extensions/EGMap/EGMapKMLService.php
  25. +177 −0 extensions/EGMap/EGMapKeyDragZoom.php
  26. +43 −0 extensions/EGMap/EGMapLatLonControl.php
  27. +405 −0 extensions/EGMap/EGMapMarker.php
  28. +125 −0 extensions/EGMap/EGMapMarkerClusterer.php
  29. +255 −0 extensions/EGMap/EGMapMarkerImage.php
  30. +147 −0 extensions/EGMap/EGMapMarkerWithLabel.php
  31. +89 −0 extensions/EGMap/EGMapPoint.php
  32. +91 −0 extensions/EGMap/EGMapSize.php
  33. +1,018 −0 extensions/EGMap/assets/geoxml3.js
  34. +1 −0 extensions/EGMap/assets/infobox_packed.js
  35. +1 −0 extensions/EGMap/assets/keydragzoom_packed.js
  36. +81 −0 extensions/EGMap/assets/latloncontrol.js
  37. +1 −0 extensions/EGMap/assets/markerclusterer_packed.js
  38. BIN extensions/EGMap/assets/markers/m1.png
  39. BIN extensions/EGMap/assets/markers/m2.png
  40. BIN extensions/EGMap/assets/markers/m3.png
  41. BIN extensions/EGMap/assets/markers/m4.png
  42. BIN extensions/EGMap/assets/markers/m5.png
  43. +1 −0 extensions/EGMap/assets/markerwithlabel_packed.js
  44. +394 −0 extensions/EGMap/kml/EGMapKMLFeed.php
  45. +74 −0 extensions/EGMap/kml/EGMapKMLIconStyle.php
  46. +86 −0 extensions/EGMap/kml/EGMapKMLLineString.php
  47. +86 −0 extensions/EGMap/kml/EGMapKMLLineStyle.php
  48. +139 −0 extensions/EGMap/kml/EGMapKMLNode.php
  49. +76 −0 extensions/EGMap/kml/EGMapKMLPlacemark.php
  50. +95 −0 extensions/EGMap/kml/EGMapKMLPoint.php
  51. +61 −0 extensions/EGMap/kml/EGMapKMLPolyStyle.php
  52. +131 −0 extensions/EGMap/kml/EGMapKMLPolygon.php
  53. +232 −0 extensions/EGeoIp/EGeoIP.php
  54. +550 −0 extensions/EGeoNameService/EGeoNameService.php
  55. +353 −0 extensions/EHttpClient/ECookieJar.php
  56. +430 −0 extensions/EHttpClient/EHostnameValidator.php
  57. +1,148 −0 extensions/EHttpClient/EHttpClient.php
  58. +335 −0 extensions/EHttpClient/EHttpCookie.php
  59. +631 −0 extensions/EHttpClient/EHttpResponse.php
  60. +169 −0 extensions/EHttpClient/EUri.php
  61. +690 −0 extensions/EHttpClient/EUriHttp.php
  62. +492 −0 extensions/EHttpClient/adapter/EHttpClientAdapterCurl.php
  63. +87 −0 extensions/EHttpClient/adapter/EHttpClientAdapterInterface.php
  64. +342 −0 extensions/EHttpClient/adapter/EHttpClientAdapterSocket.php
  65. +56 −0 extensions/EHttpClient/adapter/EHttpClientAdapterStream.php
  66. +11 −0 extensions/EHttpClient/adapter/EHttpClientException.php
  67. +278 −0 extensions/EHttpClient/adapter/EProxy.php
  68. +1,111 −0 extensions/EWebBrowser/EWebBrowser.php
  69. +262 −0 helpers/ECurrencyHelper/ECurrencyHelper.php
  70. +143 −0 helpers/EDownloadHelper/EDownloadHelper.php
  71. +108 −0 helpers/EIniHelper/EIniHelper.php
  72. +11 −0 helpers/EIniHelper/settings.ini
  73. +84 −0 validators /EABARoutingNumberValidator/EABARoutingNumberValidator.php
  74. +209 −0 validators /ECCValidator/ECCValidator.php
  75. +144 −0 validators /EConditionalValidator/EConditionalValidator.php
  76. +204 −0 validators /EIBANValidator/EIBANValidator.php
  77. +112 −0 widgets/EDateRangePicker/EDateRangePicker.php
  78. +746 −0 widgets/EDateRangePicker/assets/daterange/jquery.daterangepicker.js
  79. +103 −0 widgets/EDateRangePicker/assets/daterange/ui.daterangepicker.css
  80. +42 −0 widgets/jqPrettyPhoto/jqPrettyPhoto.php
  81. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_rounded/btnNext.png
  82. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_rounded/btnPrevious.png
  83. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_rounded/contentPattern.png
  84. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_rounded/default_thumbnail.gif
  85. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_rounded/loader.gif
  86. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_rounded/sprite.png
  87. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_square/btnNext.png
  88. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_square/btnPrevious.png
  89. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_square/contentPattern.png
  90. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_square/default_thumbnail.gif
  91. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_square/loader.gif
  92. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/dark_square/sprite.png
  93. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/btnNext.png
  94. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/btnPrevious.png
  95. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/contentPatternBottom.png
  96. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/contentPatternLeft.png
  97. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/contentPatternRight.png
  98. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/contentPatternTop.png
  99. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/default_thumbnail.gif
  100. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/loader.gif
  101. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/facebook/sprite.png
  102. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_rounded/btnNext.png
  103. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_rounded/btnPrevious.png
  104. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_rounded/default_thumbnail.gif
  105. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_rounded/loader.gif
  106. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_rounded/sprite.png
  107. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_square/btnNext.png
  108. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_square/btnPrevious.png
  109. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_square/default_thumbnail.gif
  110. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_square/loader.gif
  111. BIN widgets/jqPrettyPhoto/prettyPhoto/css/images/light_square/sprite.png
  112. +453 −0 widgets/jqPrettyPhoto/prettyPhoto/css/prettyPhoto.css
  113. +151 −0 widgets/jqPrettyPhoto/prettyPhoto/index.html
  114. +1 −0 widgets/jqPrettyPhoto/prettyPhoto/jquery.prettyPhoto.js
@@ -0,0 +1,55 @@
+<?php
+/**
+ * EDateFormatBehavior class
+ *
+ * @author Antonio Ramirez <antonio@ramirezcobos.com>
+ */
+class EDateFormatBehavior extends CActiveRecordBehavior
+{
+ //.. array of columns that have dates to be converted
+ public $dateColumns = array();
+ public $dateTimeColumns = array();
+
+ public $dateFormat = 'm/d/Y';
+ public $dateTimeFormat = 'm/d/Y H:i';
+ /**
+ * Convert from $dateFormat to UNIX timestamp dates before saving
+ */
+ public function beforeSave($event)
+ {
+ $this->format($this->dateColumns, $this->dateFormat);
+ $this->format($this->dateTimeColumns, $this->dateTimeFormat);
+ return parent::beforeSave($event);
+ }
+ /**
+ * Converts UNIX timestamp dates to $dateFormat after read from database
+ */
+ public function afterFind($event)
+ {
+ $this->format($this->dateColumns, $this->dateFormat, false);
+ $this->format($this->dateTimeColumns, $this->dateTimeFormat, false);
+ return parent::afterFind($event);
+ }
+ /**
+ *
+ * Formats to UNIX timestamp or $dateFormat as specified. Note that
+ * if using $dateFormat then assumed timestamp value
+ * @param array $columns the columns attributes to format
+ * @param string $format the format to convert the date to
+ * @param boolean $strtotime if boolean, will convert to UNIX timestamp
+ * @return void
+ */
+ protected function format($columns, $format, $strtotime=true)
+ {
+ if(empty($columns)) return;
+
+ foreach($this->getOwner()->getAttributes() as $key=>$value)
+ {
+ if(in_array($key, $columns) && !empty($value))
+ {
+ $dt = $this->getOwner()->{$key};
+ $this->getOwner()->{$key} = $strtotime ? strtotime($dt) : date($format,$dt);
+ }
+ }
+ }
+}
@@ -0,0 +1,38 @@
+<?php
+class EJsonBehavior extends CBehavior{
+
+ private $owner;
+ private $relations;
+
+ public function toJSON(){
+ $this->owner = $this->getOwner();
+
+ if (is_subclass_of($this->owner,'CActiveRecord')){
+
+ $attributes = $this->owner->getAttributes();
+ $this->relations = $this->getRelated();
+
+ $jsonDataSource = array('jsonDataSource'=>array('attributes'=>$attributes,'relations'=>$this->relations));
+
+ return CJSON::encode($jsonDataSource);
+ }
+ return false;
+ }
+ private function getRelated()
+ {
+ $related = array();
+
+ $obj = null;
+
+ $md=$this->owner->getMetaData();
+
+ foreach($md->relations as $name=>$relation){
+
+ $obj = $this->owner->getRelated($name);
+
+ $related[$name] = $obj instanceof CActiveRecord ? $obj->getAttributes() : $obj;
+ }
+
+ return $related;
+ }
+}
Oops, something went wrong.

0 comments on commit c56bee5

Please sign in to comment.