Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PFFormPrinter Class Reference

Public Member Functions

 setSemanticTypeHook ( $type, $is_list, $class_name, $default_args)
 
 setCargoTypeHook ( $type, $is_list, $class_name, $default_args)
 
 setInputTypeHook ( $input_type, $class_name, $default_args)
 
 registerInputType ( $inputTypeClass)
 
 getInputType ( $inputTypeName)
 
 getDefaultInputTypeSMW ( $isList, $propertyType)
 
 getDefaultInputTypeCargo ( $isList, $fieldType)
 
 getPossibleInputTypesSMW ( $isList, $propertyType)
 
 getPossibleInputTypesCargo ( $isList, $fieldType)
 
 getAllInputTypes ()
 
 showDeletionLog ( $out)
 
 strReplaceFirst ( $search, $replace, $subject)
 
 multipleTemplateStartHTML ( $tif)
 
 multipleTemplateInstanceTableHTML ( $form_is_disabled, $mainText)
 
 multipleTemplateInstanceHTML ( $template_in_form, $form_is_disabled, &$section)
 
 multipleTemplateEndHTML ( $template_in_form, $form_is_disabled, $section)
 
 tableHTML ( $tif, $instanceNum)
 
 spreadsheetHTML ( $tif)
 
 getStringForCurrentTime ( $includeTime, $includeTimezone)
 
 formHTML ( $form_def, $form_submitted, $source_is_page, $form_id=null, $existing_page_content=null, $page_name=null, $page_name_formula=null, $is_query=false, $is_embedded=false)
 
 formFieldHTML ( $form_field, $cur_value)
 

Static Public Member Functions

static placeholderFormat ( $templateName, $fieldName)
 
static makePlaceholderInFormHTML ( $str)
 
static getStringFromPassedInArray ( $value, $delimiter)
 
static displayLoadingImage ()
 

Public Attributes

 $mSemanticTypeHooks
 
 $mCargoTypeHooks
 
 $mInputTypeHooks
 
 $standardInputsIncluded
 
 $mPageTitle
 

Member Function Documentation

◆ formFieldHTML()

PFFormPrinter::formFieldHTML (   $form_field,
  $cur_value 
)

Create the HTML to display this field within a form.

Parameters
PFFormField$form_field
string$cur_value
Returns
string

◆ formHTML()

PFFormPrinter::formHTML (   $form_def,
  $form_submitted,
  $source_is_page,
  $form_id = null,
  $existing_page_content = null,
  $page_name = null,
  $page_name_formula = null,
  $is_query = false,
  $is_embedded = false 
)

This function is the real heart of the entire Page Forms extension. It handles two main actions: (1) displaying a form on the screen, given a form definition and possibly page contents (if an existing page is being edited); and (2) creating actual page contents, if the form was already submitted by the user.

It also does some related tasks, like figuring out the page name (if only a page formula exists).

Parameters
string$form_def
bool$form_submitted
bool$source_is_page
string | null$form_id
string | null$existing_page_content
string | null$page_name
string | null$page_name_formula
bool$is_query
bool$is_embedded
Returns
array

◆ getStringForCurrentTime()

PFFormPrinter::getStringForCurrentTime (   $includeTime,
  $includeTimezone 
)

Get a string representing the current time, for the time zone specified in the wiki.

Parameters
string$includeTime
string$includeTimezone
Returns
string

◆ getStringFromPassedInArray()

static PFFormPrinter::getStringFromPassedInArray (   $value,
  $delimiter 
)
static

If the value passed in for a certain field, when a form is submitted, is an array, then it might be from a checkbox or date input - in that case, convert it into a string.

Parameters
string$value
string$delimiter
Returns
string

◆ multipleTemplateEndHTML()

PFFormPrinter::multipleTemplateEndHTML (   $template_in_form,
  $form_is_disabled,
  $section 
)

Creates the end of the HTML for a multiple-instance template - including the sections necessary for adding additional instances.

Parameters
PFTemplateInForm$template_in_form
bool$form_is_disabled
string$section
Returns
string

◆ multipleTemplateInstanceHTML()

PFFormPrinter::multipleTemplateInstanceHTML (   $template_in_form,
  $form_is_disabled,
$section 
)

Creates the HTML for a single instance of a multiple-instance template.

Parameters
PFTemplateInForm$template_in_form
bool$form_is_disabled
string&$section
Returns
string

◆ multipleTemplateInstanceTableHTML()

PFFormPrinter::multipleTemplateInstanceTableHTML (   $form_is_disabled,
  $mainText 
)

Creates the HTML for the inner table for every instance of a multiple-instance template in the form.

Parameters
bool$form_is_disabled
string$mainText
Returns
string

◆ registerInputType()

PFFormPrinter::registerInputType (   $inputTypeClass)

Register all information about the passed-in form input class.

Parameters
string$inputTypeClassThe full qualified class name representing the new input. Must be derived from PFFormInput.

◆ showDeletionLog()

PFFormPrinter::showDeletionLog (   $out)

Show the set of previous deletions for the page being edited.

Parameters
OutputPage$out
Returns
true

◆ strReplaceFirst()

PFFormPrinter::strReplaceFirst (   $search,
  $replace,
  $subject 
)

Like PHP's str_replace(), but only replaces the first found instance - unfortunately, str_replace() doesn't allow for that. This code is basically copied directly from http://www.php.net/manual/en/function.str-replace.php#86177

  • this might make sense in the PFUtils class, if it's useful in other places.
    Parameters
    string$search
    string$replace
    string$subject
    Returns
    string

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy