Changeset 14081
- Timestamp:
- 12/21/07 18:36:17 (10 months ago)
- Files:
-
- trunk/midcom/midcom.helper.schemaapi/field.php (modified) (5 diffs)
- trunk/midcom/midcom.helper.schemaapi/schema.php (modified) (7 diffs)
- trunk/midcom/midcom.helper.schemaapi/supertype.php (modified) (2 diffs)
- trunk/midcom/midcom.helper.schemaapi/type/date.php (modified) (2 diffs)
- trunk/midcom/midcom.helper.schemaapi/type/number.php (modified) (2 diffs)
- trunk/midcom/midcom.helper.schemaapi/type/password.php (modified) (2 diffs)
- trunk/midcom/midcom.helper.schemaapi/type/text.php (modified) (2 diffs)
- trunk/midcom/midcom.helper.schemaapi/widget/jsdate.php (modified) (1 diff)
- trunk/midcom/midcom.helper.schemaapi/widget/password.php (modified) (1 diff)
- trunk/midcom/midcom.helper.schemaapi/widget/text.php (modified) (1 diff)
- trunk/midcom/midcom.helper.schemaapi/widget/tinymce.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.schemaapi/field.php
r5029 r14081 1 1 <?php 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 2 8 3 class midcom_helper_schemaapi_field 9 class midcom_helper_schemaapi_field 4 10 { 5 11 protected $name; … … 9 15 protected $type; 10 16 11 public function __construct ( $name, $storage, $title ) 17 public function __construct ( $name, $storage, $title ) 12 18 { 13 19 $this->name = $name; … … 16 22 } 17 23 18 24 19 25 public function set_type ( $type ) { 20 26 … … 28 34 public function asArray( ) { 29 35 $ret = array( ); 30 $ret[$this->name] = array( 36 $ret[$this->name] = array( 31 37 'title' => $this->title, 32 38 'storage' => $this->storage, … … 36 42 //'widget_config' => $this->widget->get_config( ) , 37 43 ); 38 if ( count ( $this->widget->get_config( ) ) > 0 ) 44 if ( count ( $this->widget->get_config( ) ) > 0 ) 39 45 { 40 46 $ret[$this->name]['widget_config'] = $this->widget->get_config( ); 41 47 } 42 if ( count ( $this->type->get_config( ) ) ) 48 if ( count ( $this->type->get_config( ) ) ) 43 49 { 44 50 $ret[$this->name]['type_config'] = $this->type->get_config( ); trunk/midcom/midcom.helper.schemaapi/schema.php
r5029 r14081 1 1 <?php 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 2 9 require_once 'field.php'; 3 10 require_once 'supertype.php'; 4 class midcom_helper_schemaapi_schema 11 class midcom_helper_schemaapi_schema 5 12 { 6 13 … … 9 16 protected $fields = array( ); 10 17 11 public function __construct( ) 18 public function __construct( ) 12 19 { 13 20 14 21 } 15 22 16 public function asString ( ) 23 public function asString ( ) 17 24 { 18 25 $out = array( ); 19 $out[$this->name] = array ( 26 $out[$this->name] = array ( 20 27 'description' => $this->description, 21 28 'fields' => $this->fields, … … 33 40 } 34 41 35 public function set_description( $desc ) 42 public function set_description( $desc ) 36 43 { 37 44 $this->description = $desc; 38 45 } 39 46 40 public function get_description( ) 47 public function get_description( ) 41 48 { 42 49 return $this->description; … … 44 51 /** 45 52 * adds a field to the fieldarray 46 * @param midcom_helper_schemaapi_field 53 * @param midcom_helper_schemaapi_field 47 54 */ 48 public function add_field( $field ) 55 public function add_field( $field ) 49 56 { 50 57 $this->fields = array_merge( $this->fields ,$field->asArray( )); … … 58 65 $class =<<<EOF 59 66 <?php 60 class midcom_helper_schemaapi_widget_$widget extends midcom_helper_schemaapi_supertype 67 class midcom_helper_schemaapi_widget_$widget extends midcom_helper_schemaapi_supertype 61 68 { 62 69 … … 79 86 $class =<<<EOF 80 87 <?php 81 class midcom_helper_schemaapi_type_$type extends midcom_helper_schemaapi_supertype 88 class midcom_helper_schemaapi_type_$type extends midcom_helper_schemaapi_supertype 82 89 { 83 90 … … 86 93 parent::__construct( "$type" ); 87 94 } 88 95 89 96 } 90 97 ?> trunk/midcom/midcom.helper.schemaapi/supertype.php
r5029 r14081 1 1 <?php 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 2 9 /** 3 10 * Types and widgets use the same overarching interface so no need for different classes there. … … 9 16 public function __construct( $name ) 10 17 { 11 $this->name = $name; 18 $this->name = $name; 12 19 } 13 20 14 public function get_name( ) 21 public function get_name( ) 15 22 { 16 23 return $this->name; 17 24 } 18 25 19 public function get_config( ) 26 public function get_config( ) 20 27 { 21 28 return $this->config; trunk/midcom/midcom.helper.schemaapi/type/date.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_type_date extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 9 class midcom_helper_schemaapi_type_date extends midcom_helper_schemaapi_supertype 3 10 { 4 11 … … 7 14 parent::__construct( "date" ); 8 15 } 9 16 10 17 } 11 18 ?> trunk/midcom/midcom.helper.schemaapi/type/number.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_type_number extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 9 class midcom_helper_schemaapi_type_number extends midcom_helper_schemaapi_supertype 3 10 { 4 11 … … 7 14 parent::__construct( "number" ); 8 15 } 9 16 10 17 } 11 18 ?> trunk/midcom/midcom.helper.schemaapi/type/password.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_type_password extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 9 class midcom_helper_schemaapi_type_password extends midcom_helper_schemaapi_supertype 3 10 { 4 11 … … 7 14 parent::__construct( "password" ); 8 15 } 9 16 10 17 } 11 18 ?> trunk/midcom/midcom.helper.schemaapi/type/text.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_type_text extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 class midcom_helper_schemaapi_type_text extends midcom_helper_schemaapi_supertype 3 9 { 4 10 … … 7 13 parent::__construct( "text" ); 8 14 } 9 15 10 16 } 11 17 ?> trunk/midcom/midcom.helper.schemaapi/widget/jsdate.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_widget_jsdate extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 9 class midcom_helper_schemaapi_widget_jsdate extends midcom_helper_schemaapi_supertype 3 10 { 4 11 trunk/midcom/midcom.helper.schemaapi/widget/password.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_widget_password extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 9 class midcom_helper_schemaapi_widget_password extends midcom_helper_schemaapi_supertype 3 10 { 4 11 trunk/midcom/midcom.helper.schemaapi/widget/text.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_widget_text extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 9 class midcom_helper_schemaapi_widget_text extends midcom_helper_schemaapi_supertype 3 10 { 4 11 trunk/midcom/midcom.helper.schemaapi/widget/tinymce.php
r5029 r14081 1 1 <?php 2 class midcom_helper_schemaapi_widget_tinymce extends midcom_helper_schemaapi_supertype 2 /** 3 * @package midcom.helper.schemaapi 4 * @author The Midgard Project, http://www.midgard-project.org 5 * @copyright The Midgard Project, http://www.midgard-project.org 6 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 7 */ 8 9 class midcom_helper_schemaapi_widget_tinymce extends midcom_helper_schemaapi_supertype 3 10 { 4 11
