2013-02-22 18:50:54 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents the information about a template,
|
|
|
|
* coming from the JSON blob in the <templatedata> tags
|
|
|
|
* on wiki pages.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
*/
|
|
|
|
class TemplateDataBlob {
|
2013-07-23 12:29:43 +00:00
|
|
|
// Size of MySQL 'blob' field; page_props table where the data is stored uses one.
|
|
|
|
const MAX_LENGTH = 65535;
|
2013-04-22 20:02:09 +00:00
|
|
|
|
2013-02-22 18:50:54 +00:00
|
|
|
/**
|
|
|
|
* @var stdClass
|
|
|
|
*/
|
|
|
|
private $data;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Status: Cache of TemplateInfo::validate
|
|
|
|
*/
|
|
|
|
private $status;
|
|
|
|
|
|
|
|
/**
|
2013-04-22 19:56:28 +00:00
|
|
|
* @param string $json
|
2013-02-22 18:50:54 +00:00
|
|
|
* @return TemplateInfo
|
|
|
|
*/
|
|
|
|
public static function newFromJSON( $json ) {
|
2013-04-22 19:56:28 +00:00
|
|
|
$tdb = new self( json_decode( $json ) );
|
|
|
|
$status = $tdb->parse();
|
2013-02-22 18:50:54 +00:00
|
|
|
|
|
|
|
if ( !$status->isOK() ) {
|
|
|
|
// Don't save invalid data, clear it.
|
2013-04-22 19:56:28 +00:00
|
|
|
$tdb->data = new stdClass();
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
2013-04-22 19:56:28 +00:00
|
|
|
$tdb->status = $status;
|
|
|
|
return $tdb;
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parse the data, normalise it and validate it.
|
|
|
|
*
|
|
|
|
* See spec.templatedata.json for the expected format of the JSON object.
|
|
|
|
* @return Status
|
|
|
|
*/
|
|
|
|
private function parse() {
|
|
|
|
$data = $this->data;
|
|
|
|
|
2013-04-30 22:32:08 +00:00
|
|
|
static $rootKeys = array(
|
|
|
|
'description',
|
2013-05-15 22:15:52 +00:00
|
|
|
'params',
|
|
|
|
'sets',
|
2013-04-30 22:32:08 +00:00
|
|
|
);
|
|
|
|
static $paramKeys = array(
|
2013-05-08 23:56:57 +00:00
|
|
|
'label',
|
2013-04-30 22:32:08 +00:00
|
|
|
'required',
|
|
|
|
'description',
|
|
|
|
'deprecated',
|
|
|
|
'aliases',
|
|
|
|
'default',
|
|
|
|
'inherits',
|
2013-05-08 23:56:57 +00:00
|
|
|
'type',
|
|
|
|
);
|
|
|
|
static $types = array(
|
|
|
|
'unknown',
|
|
|
|
'string',
|
|
|
|
'number',
|
|
|
|
'string/wiki-page-name',
|
|
|
|
'string/wiki-user-name',
|
2013-07-03 20:22:48 +00:00
|
|
|
'string/line',
|
2013-04-30 22:32:08 +00:00
|
|
|
);
|
|
|
|
|
2013-02-22 18:50:54 +00:00
|
|
|
if ( $data === null ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-parse' );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !is_object( $data ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-type', 'templatedata', 'object' );
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ( $data as $key => $value ) {
|
2013-04-30 22:32:08 +00:00
|
|
|
if ( !in_array( $key, $rootKeys ) ) {
|
2013-02-22 18:50:54 +00:00
|
|
|
return Status::newFatal( 'templatedata-invalid-unknown', $key );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:22:25 +00:00
|
|
|
// Root.description
|
2013-02-22 18:50:54 +00:00
|
|
|
if ( isset( $data->description ) ) {
|
2013-04-16 14:18:10 +00:00
|
|
|
if ( !is_object( $data->description ) && !is_string( $data->description ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-type', 'description', 'string|object' );
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
2013-04-16 14:18:10 +00:00
|
|
|
$data->description = self::normaliseInterfaceText( $data->description );
|
2013-02-22 18:50:54 +00:00
|
|
|
} else {
|
2013-05-08 23:56:57 +00:00
|
|
|
$data->description = null;
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
|
2013-04-30 21:22:25 +00:00
|
|
|
// Root.params
|
|
|
|
if ( !isset( $data->params ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-missing', 'params', 'object' );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !is_object( $data->params ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-type', 'params', 'object' );
|
|
|
|
}
|
|
|
|
|
2013-04-30 22:32:08 +00:00
|
|
|
// Deep clone
|
|
|
|
// We need this to determine whether a property was originally set
|
|
|
|
// to decide whether 'inherits' will add it or not.
|
|
|
|
$unnormalizedParams = unserialize( serialize( $data->params ) );
|
|
|
|
|
2013-02-22 18:50:54 +00:00
|
|
|
foreach ( $data->params as $paramName => $paramObj ) {
|
|
|
|
if ( !is_object( $paramObj ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}",
|
|
|
|
'object'
|
|
|
|
);
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach ( $paramObj as $key => $value ) {
|
2013-04-30 22:32:08 +00:00
|
|
|
if ( !in_array( $key, $paramKeys ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-unknown',
|
|
|
|
"params.{$paramName}.{$key}"
|
|
|
|
);
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-08 23:56:57 +00:00
|
|
|
// Param.label
|
|
|
|
if ( isset( $paramObj->label ) ) {
|
|
|
|
if ( !is_object( $paramObj->label ) && !is_string( $paramObj->label ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
// TODO: Also validate that the keys are valid lang codes and the values strings.
|
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}.label",
|
|
|
|
'string|object'
|
|
|
|
);
|
2013-05-08 23:56:57 +00:00
|
|
|
}
|
|
|
|
$paramObj->label = self::normaliseInterfaceText( $paramObj->label );
|
|
|
|
} else {
|
|
|
|
$paramObj->label = null;
|
|
|
|
}
|
2013-04-30 21:22:25 +00:00
|
|
|
|
|
|
|
// Param.required
|
2013-02-22 18:50:54 +00:00
|
|
|
if ( isset( $paramObj->required ) ) {
|
|
|
|
if ( !is_bool( $paramObj->required ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}.required",
|
|
|
|
'boolean'
|
|
|
|
);
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$paramObj->required = false;
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:22:25 +00:00
|
|
|
// Param.description
|
2013-02-22 18:50:54 +00:00
|
|
|
if ( isset( $paramObj->description ) ) {
|
|
|
|
if ( !is_object( $paramObj->description ) && !is_string( $paramObj->description ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
// TODO: Also validate that the keys are valid lang codes and the values strings.
|
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}.description",
|
|
|
|
'string|object'
|
|
|
|
);
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
2013-04-16 14:18:10 +00:00
|
|
|
$paramObj->description = self::normaliseInterfaceText( $paramObj->description );
|
2013-02-22 18:50:54 +00:00
|
|
|
} else {
|
2013-05-08 23:56:57 +00:00
|
|
|
$paramObj->description = null;
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
|
2013-04-30 21:22:25 +00:00
|
|
|
// Param.deprecated
|
2013-02-22 18:50:54 +00:00
|
|
|
if ( isset( $paramObj->deprecated ) ) {
|
2013-04-22 19:56:28 +00:00
|
|
|
if ( $paramObj->deprecated !== false && !is_string( $paramObj->deprecated ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}.deprecated",
|
|
|
|
'boolean|string'
|
|
|
|
);
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$paramObj->deprecated = false;
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:22:25 +00:00
|
|
|
// Param.aliases
|
2013-02-22 18:50:54 +00:00
|
|
|
if ( isset( $paramObj->aliases ) ) {
|
|
|
|
if ( !is_array( $paramObj->aliases ) ) {
|
|
|
|
// TODO: Validate the array values.
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}.aliases",
|
|
|
|
'array'
|
|
|
|
);
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$paramObj->aliases = array();
|
|
|
|
}
|
|
|
|
|
2013-04-30 21:22:25 +00:00
|
|
|
// Param.default
|
2013-02-22 18:50:54 +00:00
|
|
|
if ( isset( $paramObj->default ) ) {
|
|
|
|
if ( !is_string( $paramObj->default ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}.default",
|
|
|
|
'string'
|
|
|
|
);
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$paramObj->default = '';
|
|
|
|
}
|
2013-04-30 21:22:25 +00:00
|
|
|
|
2013-05-08 23:56:57 +00:00
|
|
|
// Param.type
|
|
|
|
if ( isset( $paramObj->type ) ) {
|
|
|
|
if ( !is_string( $paramObj->type ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"params.{$paramName}.type",
|
|
|
|
'string'
|
|
|
|
);
|
2013-05-08 23:56:57 +00:00
|
|
|
}
|
|
|
|
if ( !in_array( $paramObj->type, $types ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-value',
|
|
|
|
'params.' . $paramName . '.type'
|
|
|
|
);
|
2013-05-08 23:56:57 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$paramObj->type = 'unknown';
|
|
|
|
}
|
2013-02-22 18:50:54 +00:00
|
|
|
}
|
|
|
|
|
2013-04-30 22:32:08 +00:00
|
|
|
// Param.inherits
|
|
|
|
// Done afterwards to avoid code duplication
|
|
|
|
foreach ( $data->params as $paramName => $paramObj ) {
|
|
|
|
if ( isset( $paramObj->inherits ) ) {
|
|
|
|
if ( !isset( $data->params->{ $paramObj->inherits } ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-missing',
|
|
|
|
"params.{$paramObj->inherits}"
|
|
|
|
);
|
2013-04-30 22:32:08 +00:00
|
|
|
}
|
|
|
|
$parentParamObj = $data->params->{ $paramObj->inherits };
|
|
|
|
foreach ( $parentParamObj as $key => $value ) {
|
|
|
|
if ( !in_array( $key, $paramKeys ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-unknown', $key );
|
|
|
|
}
|
|
|
|
if ( !isset( $unnormalizedParams->$paramName->$key ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
$paramObj->$key = is_object( $parentParamObj->$key )
|
|
|
|
? clone $parentParamObj->$key
|
|
|
|
: $parentParamObj->$key;
|
2013-04-30 22:32:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
unset( $paramObj->inherits );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-15 22:15:52 +00:00
|
|
|
// Root.sets
|
|
|
|
if ( isset( $data->sets ) ) {
|
|
|
|
if ( !is_array( $data->sets ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-type', 'sets', 'array' );
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$data->sets = array();
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ( $data->sets as $setNr => $setObj ) {
|
|
|
|
if ( !is_object( $setObj ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-type', "sets.{$setNr}", 'object' );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !isset( $setObj->label ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-missing',
|
|
|
|
"sets.{$setNr}.label",
|
|
|
|
'string|object'
|
|
|
|
);
|
2013-05-15 22:15:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( !is_object( $setObj->label ) && !is_string( $setObj->label ) ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
// TODO: Also validate that the keys are valid lang codes and the values strings.
|
|
|
|
return Status::newFatal(
|
|
|
|
'templatedata-invalid-type',
|
|
|
|
"sets.{$setNr}.label",
|
|
|
|
'string|object'
|
|
|
|
);
|
2013-05-15 22:15:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$setObj->label = self::normaliseInterfaceText( $setObj->label );
|
|
|
|
|
|
|
|
if ( !isset( $setObj->params ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-missing', "sets.{$setNr}.params", 'array' );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !is_array( $setObj->params ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-type', "sets.{$setNr}.params", 'array' );
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ( $setObj->params as $param ) {
|
|
|
|
if ( !isset( $data->params->$param ) ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-missing', "params.{$param}" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-04-30 21:22:25 +00:00
|
|
|
|
2013-07-23 12:29:43 +00:00
|
|
|
$length = strlen( $this->getJSON() );
|
|
|
|
if ( $length > self::MAX_LENGTH ) {
|
|
|
|
return Status::newFatal( 'templatedata-invalid-length', $length, self::MAX_LENGTH );
|
|
|
|
}
|
|
|
|
|
2013-02-22 18:50:54 +00:00
|
|
|
return Status::newGood();
|
|
|
|
}
|
|
|
|
|
2013-04-16 14:18:10 +00:00
|
|
|
/**
|
|
|
|
* Normalise a InterfaceText field in the TemplateData blob.
|
|
|
|
* @return stdClass|string $text
|
|
|
|
*/
|
|
|
|
protected static function normaliseInterfaceText( $text ) {
|
|
|
|
if ( is_string( $text ) ) {
|
|
|
|
global $wgContLang;
|
2013-07-31 23:44:35 +00:00
|
|
|
$ret = new stdClass();
|
|
|
|
$ret->{ $wgContLang->getCode() } = $text;
|
|
|
|
return $ret;
|
2013-04-16 14:18:10 +00:00
|
|
|
}
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|
2013-02-22 18:50:54 +00:00
|
|
|
public function getStatus() {
|
|
|
|
return $this->status;
|
|
|
|
}
|
|
|
|
|
2013-04-22 19:56:28 +00:00
|
|
|
public function getData() {
|
|
|
|
// Returned by reference. Data is a private member. Use clone instead?
|
|
|
|
return $this->data;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string JSON
|
|
|
|
*/
|
2013-02-22 18:50:54 +00:00
|
|
|
public function getJSON() {
|
|
|
|
return json_encode( $this->data );
|
|
|
|
}
|
|
|
|
|
2013-08-01 20:57:42 +00:00
|
|
|
public function getHtml( Language $lang ) {
|
2013-04-22 20:02:09 +00:00
|
|
|
global $wgContLang;
|
|
|
|
$langCode = $wgContLang->getCode();
|
2013-02-22 18:50:54 +00:00
|
|
|
$data = $this->data;
|
|
|
|
$html =
|
|
|
|
Html::openElement( 'div', array( 'class' => 'mw-templatedata-doc-wrap' ) )
|
2013-08-01 20:57:42 +00:00
|
|
|
. Html::element(
|
|
|
|
'p',
|
|
|
|
array( 'class' => 'mw-templatedata-doc-desc' ),
|
|
|
|
$data->description->$langCode
|
|
|
|
)
|
2013-04-30 22:32:31 +00:00
|
|
|
. '<table class="wikitable mw-templatedata-doc-params">'
|
2013-08-01 20:57:42 +00:00
|
|
|
. Html::element(
|
|
|
|
'caption',
|
|
|
|
array(),
|
|
|
|
wfMessage( 'templatedata-doc-params' )->inLanguage( $lang )
|
|
|
|
)
|
2013-02-22 18:50:54 +00:00
|
|
|
. '<thead><tr>'
|
2013-08-01 20:57:42 +00:00
|
|
|
. Html::element(
|
|
|
|
'th',
|
|
|
|
array( 'colspan' => 2 ),
|
|
|
|
wfMessage( 'templatedata-doc-param-name' )->inLanguage( $lang )
|
|
|
|
)
|
|
|
|
. Html::element(
|
|
|
|
'th',
|
|
|
|
array(),
|
|
|
|
wfMessage( 'templatedata-doc-param-desc' )->inLanguage( $lang )
|
|
|
|
)
|
|
|
|
. Html::element(
|
|
|
|
'th',
|
|
|
|
array(),
|
|
|
|
wfMessage( 'templatedata-doc-param-type' )->inLanguage( $lang )
|
|
|
|
)
|
|
|
|
. Html::element(
|
|
|
|
'th',
|
|
|
|
array(),
|
|
|
|
wfMessage( 'templatedata-doc-param-default' )->inLanguage( $lang )
|
|
|
|
)
|
|
|
|
. Html::element(
|
|
|
|
'th',
|
|
|
|
array(),
|
|
|
|
wfMessage( 'templatedata-doc-param-status' )->inLanguage( $lang )
|
|
|
|
)
|
2013-02-22 18:50:54 +00:00
|
|
|
. '</tr></thead>'
|
2013-05-16 15:01:00 +00:00
|
|
|
. '<tbody>';
|
|
|
|
|
2013-02-22 18:50:54 +00:00
|
|
|
foreach ( $data->params as $paramName => $paramObj ) {
|
|
|
|
$description = '';
|
|
|
|
$default = '';
|
2013-05-08 23:56:57 +00:00
|
|
|
|
|
|
|
$aliases = '';
|
|
|
|
if ( count( $paramObj->aliases ) ) {
|
|
|
|
foreach ( $paramObj->aliases as $alias ) {
|
2013-05-16 15:01:00 +00:00
|
|
|
$aliases .= Html::element( 'tt', array(
|
|
|
|
'class' => 'mw-templatedata-doc-param-alias'
|
|
|
|
), $alias );
|
2013-05-08 23:56:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-22 18:50:54 +00:00
|
|
|
$html .= '<tr>'
|
2013-05-08 23:56:57 +00:00
|
|
|
// Label
|
|
|
|
. Html::element( 'th', array(),
|
2013-05-16 15:01:00 +00:00
|
|
|
isset( $paramObj->label->$langCode )
|
|
|
|
? $paramObj->label->$langCode
|
|
|
|
: ucfirst( $paramName )
|
2013-05-08 23:56:57 +00:00
|
|
|
)
|
|
|
|
// Parameters and aliases
|
|
|
|
. Html::rawElement( 'td', array( 'class' => 'mw-templatedata-doc-param-name' ),
|
|
|
|
Html::element( 'tt', array(), $paramName ) . $aliases
|
|
|
|
)
|
2013-02-22 18:50:54 +00:00
|
|
|
// Description
|
2013-05-08 23:56:57 +00:00
|
|
|
. Html::element( 'td', array(
|
|
|
|
'class' => array(
|
2013-05-16 15:01:00 +00:00
|
|
|
'mw-templatedata-doc-muted' => (
|
|
|
|
!isset( $paramObj->description->$langCode ) && $paramObj->deprecated === false
|
|
|
|
)
|
2013-05-08 23:56:57 +00:00
|
|
|
)
|
|
|
|
),
|
2013-05-16 15:01:00 +00:00
|
|
|
isset( $paramObj->description->$langCode )
|
|
|
|
? $paramObj->description->$langCode
|
|
|
|
: 'no description'
|
2013-02-22 18:50:54 +00:00
|
|
|
)
|
2013-05-08 23:56:57 +00:00
|
|
|
// Type
|
|
|
|
. Html::rawElement( 'td', array(
|
|
|
|
'class' => array(
|
|
|
|
'mw-templatedata-doc-param-type',
|
|
|
|
'mw-templatedata-doc-muted' => $paramObj->type === 'unknown'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
Html::element( 'tt', array(), $paramObj->type )
|
|
|
|
)
|
2013-02-22 18:50:54 +00:00
|
|
|
// Default
|
|
|
|
. Html::element( 'td', array(
|
2013-05-08 23:56:57 +00:00
|
|
|
'class' => array(
|
|
|
|
'mw-templatedata-doc-muted' => $paramObj->default === ''
|
|
|
|
)
|
|
|
|
),
|
|
|
|
$paramObj->default !== '' ? $paramObj->default : 'empty'
|
|
|
|
)
|
2013-02-22 18:50:54 +00:00
|
|
|
// Status
|
|
|
|
. Html::element( 'td', array(),
|
|
|
|
$paramObj->deprecated ? 'deprecated' : (
|
|
|
|
$paramObj->required ? 'required' : 'optional'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
. '</tr>';
|
|
|
|
}
|
|
|
|
$html .= '</tbody></table>'
|
|
|
|
. Html::closeElement( 'div' );
|
|
|
|
|
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
|
2013-04-16 14:18:10 +00:00
|
|
|
private function __construct( $data = null ) {
|
2013-02-22 18:50:54 +00:00
|
|
|
$this->data = $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|