本文整理汇总了PHP中HTMLForm::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::__construct方法的具体用法?PHP HTMLForm::__construct怎么用?PHP HTMLForm::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLForm
的用法示例。
在下文中一共展示了HTMLForm::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($descriptor, $context = null, $messagePrefix = '')
{
parent::__construct($descriptor, $context, $messagePrefix);
$this->getOutput()->enableOOUI();
$this->getOutput()->addModules('mediawiki.htmlform.ooui');
$this->getOutput()->addModuleStyles('mediawiki.htmlform.ooui.styles');
}
示例2: foreach
function __construct($formID, $fields, $title = null)
{
parent::__construct($formID, $fields, $title);
foreach ($this->fields as $field) {
$this->setType($field, "checkbox");
}
}
示例3: __construct
public function __construct(IContextSource $context, $collections_message, $collection_title = '')
{
$this->collections_message = empty($collections_message) ? $collections_message : $collections_message . "<br>";
$this->collection_title = $collection_title;
$descriptor = $this->getSourceSection();
parent::__construct($descriptor, $context, 'upload');
}
示例4: __construct
public function __construct($url = null, $header = null, $method = null, $id = null)
{
parent::__construct($url, $method, $id);
$this->set_header($header);
$this->add_class(self::$_DEFAULT_CLASS);
$this->set_callback(self::$_DEFAULT_CALLBACK);
$this->set_cancel_action(self::$_DEFAULT_CANCEL_ACTION);
}
示例5: __construct
public function __construct(array $options = array(), IContextSource $context = null)
{
if ($context instanceof IContextSource) {
$this->setContext($context);
}
$this->mWatch = !empty($options['watch']);
$this->mForReUpload = !empty($options['forreupload']);
$this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
$this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
$this->mDestWarningAck = !empty($options['destwarningack']);
$this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
$this->mComment = isset($options['description']) ? $options['description'] : '';
$this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
$this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
$sourceDescriptor = $this->getSourceSection();
$descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
Hooks::run('UploadFormInitDescriptor', array(&$descriptor));
parent::__construct($descriptor, $context, 'upload');
# Add a link to edit MediaWik:Licenses
if ($this->getUser()->isAllowed('editinterface')) {
$licensesLink = Linker::linkKnown($this->msg('licenses')->inContentLanguage()->getTitle(), $this->msg('licenses-edit')->escaped(), array(), array('action' => 'edit'));
$editLicenses = '<p class="mw-upload-editlicenses">' . $licensesLink . '</p>';
$this->addFooterText($editLicenses, 'description');
}
# Set some form properties
$this->setSubmitText($this->msg('uploadbtn')->text());
$this->setSubmitName('wpUpload');
# Used message keys: 'accesskey-upload', 'tooltip-upload'
$this->setSubmitTooltip('upload');
$this->setId('mw-upload-form');
# Build a list of IDs for javascript insertion
$this->mSourceIds = array();
foreach ($sourceDescriptor as $field) {
if (!empty($field['id'])) {
$this->mSourceIds[] = $field['id'];
}
}
}
示例6: __construct
public function __construct(array $options = array(), IContextSource $context = null)
{
$this->mWatch = !empty($options['watch']);
$this->mForReUpload = !empty($options['forreupload']);
$this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
$this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
$this->mDestWarningAck = !empty($options['destwarningack']);
$this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
$this->mComment = isset($options['description']) ? $options['description'] : '';
$this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
$this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
$sourceDescriptor = $this->getSourceSection();
$descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
wfRunHooks('UploadFormInitDescriptor', array(&$descriptor));
parent::__construct($descriptor, $context, 'upload');
# Set some form properties
$this->setSubmitText($this->msg('uploadbtn')->text());
$this->setSubmitName('wpUpload');
# Used message keys: 'accesskey-upload', 'tooltip-upload'
$this->setSubmitTooltip('upload');
$this->setId('mw-upload-form');
# Build a list of IDs for javascript insertion
$this->mSourceIds = array();
foreach ($sourceDescriptor as $field) {
if (!empty($field['id'])) {
$this->mSourceIds[] = $field['id'];
}
}
}
示例7: __construct
public function __construct( $options = array() ) {
$this->mWatch = !empty( $options['watch'] );
$this->mForReUpload = !empty( $options['forreupload'] );
$this->mSessionKey = isset( $options['sessionkey'] )
? $options['sessionkey'] : '';
$this->mHideIgnoreWarning = !empty( $options['hideignorewarning'] );
$this->mDestWarningAck = !empty( $options['destwarningack'] );
$this->mDestFile = isset( $options['destfile'] ) ? $options['destfile'] : '';
$sourceDescriptor = $this->getSourceSection();
$descriptor = $sourceDescriptor
+ $this->getDescriptionSection()
+ $this->getOptionsSection();
HTMLForm::__construct( $descriptor, 'upload' );
# Set some form properties
$this->setSubmitText( wfMsg( 'uploadbtn' ) );
$this->setSubmitName( 'wpUpload' );
$this->setSubmitTooltip( 'upload' );
$this->setId( 'mw-upload-form' );
# Build a list of IDs for JavaScript insertion
$this->mSourceIds = array();
foreach ( $sourceDescriptor as $key => $field ) {
if ( !empty( $field['id'] ) ) {
$this->mSourceIds[] = $field['id'];
}
}
}
示例8: __construct
public function __construct($options = array())
{
$this->mWatch = !empty($options['watch']);
$this->mForReUpload = !empty($options['forreupload']);
$this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
$this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
$this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
$this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
$this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
$sourceDescriptor = $this->getSourceSection();
$descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
Hooks::run('UploadFormInitDescriptor', array($descriptor));
parent::__construct($descriptor, 'upload');
# Set some form properties
$this->setSubmitText(wfMessage('uploadbtn')->text());
$this->setSubmitName('wpUpload');
$this->setSubmitTooltip('upload');
$this->setId('mw-upload-form');
# Build a list of IDs for javascript insertion
$this->mSourceIds = array();
foreach ($sourceDescriptor as $key => $field) {
if (!empty($field['id'])) {
$this->mSourceIds[] = $field['id'];
}
}
// added for Semantic Forms
$this->addHiddenField('sfInputID', $options['sfInputID']);
$this->addHiddenField('sfDelimiter', $options['sfDelimiter']);
}
示例9: __construct
public function __construct($options = array(), $context = null, $messagePrefix = 'multiupload')
{
// basically we want to map filenames to session keys here somehow
$this->mDestFiles = array();
for ($i = 0; $i < MultipleUpload::getMaxUploadFiles(); $i++) {
$this->mDestFiles[$i] = $options['destfile' . $i];
}
$this->mSessionKeys = array();
foreach ($options as $k => $v) {
if (preg_match('@^sessionkey@', $k)) {
$this->mSessionKeys[$k] = $v;
}
}
// In an ideal world, this would work:
#parent::__construct( $options, $context, $messagePrefix );
// But MediaWiki is MediaWiki, so of course you can't pass the third
// parameter to UploadForm::__construct(), but instead it hardcodes it
// to 'upload'...great. So, we have to duplicate that function here. :(
$this->mWatch = !empty($options['watch']);
$this->mForReUpload = !empty($options['forreupload']);
$this->mSessionKey = isset($options['sessionkey']) ? $options['sessionkey'] : '';
$this->mHideIgnoreWarning = !empty($options['hideignorewarning']);
$this->mDestWarningAck = !empty($options['destwarningack']);
$this->mDestFile = isset($options['destfile']) ? $options['destfile'] : '';
$this->mComment = isset($options['description']) ? $options['description'] : '';
$this->mTextTop = isset($options['texttop']) ? $options['texttop'] : '';
$this->mTextAfterSummary = isset($options['textaftersummary']) ? $options['textaftersummary'] : '';
$sourceDescriptor = $this->getSourceSection();
$descriptor = $sourceDescriptor + $this->getDescriptionSection() + $this->getOptionsSection();
wfRunHooks('UploadFormInitDescriptor', array(&$descriptor));
$this->setMessagePrefix('multiupload');
HTMLForm::__construct($descriptor, $context, 'multiupload');
// here's the change
# Set some form properties
$this->setSubmitText(wfMsg('uploadbtn'));
$this->setSubmitName('wpUpload');
# Used message keys: 'accesskey-upload', 'tooltip-upload'
$this->setSubmitTooltip('upload');
$this->setId('mw-upload-form');
# Build a list of IDs for javascript insertion
$this->mSourceIds = array();
foreach ($sourceDescriptor as $field) {
if (!empty($field['id'])) {
$this->mSourceIds[] = $field['id'];
}
}
}
示例10: __construct
/**
* @param $wm Wikimania
* @param $context ContextSource
*/
public function __construct( Wikimania $wm, $context = null ) {
parent::__construct( $this->getFields( $wm, $context->getUser() ), $context, 'wikimania' );
}
示例11: __construct
public function __construct($title)
{
$this->title = $title;
$descriptors = $this->getDescriptors();
parent::__construct($descriptors, 'addresource');
}