本文整理汇总了PHP中Widget::parse方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::parse方法的具体用法?PHP Widget::parse怎么用?PHP Widget::parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget::parse方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
if (TL_MODE == 'BE') {
$this->html = htmlspecialchars($this->html);
}
return parent::parse($arrAttributes);
}
示例2: parse
/**
* Add the labels and messages.
*
* @param null $arrAttributes
*/
public function parse($arrAttributes = null)
{
// Messages (passed on to fineuploader JS)
$basicTextOptions = array('text' => array('formatProgress', 'failUpload', 'waitingForResponse', 'paused'), 'messages' => array('typeError', 'sizeError', 'minSizeError', 'emptyError', 'noFilesError', 'tooManyItemsError', 'maxHeightImageError', 'maxWidthImageError', 'minHeightImageError', 'minWidthImageError', 'retryFailTooManyItems', 'onLeave', 'unsupportedBrowserIos8Safari'), 'retry' => array('autoRetryNote'), 'deleteFile' => array('confirmMessage', 'deletingStatusText', 'deletingFailedText'), 'paste' => array('namePromptMessage'));
$config = array();
foreach ($basicTextOptions as $category => $messages) {
foreach ($messages as $message) {
// Only translate if available, otherwise fall back to default (EN)
if (isset($GLOBALS['TL_LANG']['MSC']['fineuploader_trans'][$category][$message])) {
$config[$category][$message] = $GLOBALS['TL_LANG']['MSC']['fineuploader_trans'][$category][$message];
}
}
}
// BC (used to be a JSON string)
if (isset($this->arrConfiguration['uploaderConfig']) && $this->arrConfiguration['uploaderConfig'] !== '') {
$this->arrConfiguration['uploaderConfig'] = json_decode('{' . $this->arrConfiguration['uploaderConfig'] . '}', true);
}
// Merge with custom options
$this->config = json_encode(array_merge($config, (array) $this->arrConfiguration['uploaderConfig']));
// Labels (in HTML)
$labels = array('drop', 'upload', 'processing', 'cancel', 'retry', 'delete', 'close', 'yes', 'no');
$preparedLabels = array();
foreach ($labels as $label) {
$preparedLabels[$label] = $GLOBALS['TL_LANG']['MSC']['fineuploader_' . $label];
}
$this->labels = $preparedLabels;
return parent::parse($arrAttributes);
}
示例3: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
// Return a wildcard in the back end
if (TL_MODE == 'BE') {
/** @var \BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . $GLOBALS['TL_LANG']['FFL']['colStart'][0] . ' ###';
return $objTemplate->parse();
}
return parent::parse($arrAttributes);
}
示例4: parse
/**
* Add custom HTML after the widget
*
* @param array $attributes
*
* @return string
*/
public function parse($attributes = null)
{
if (TL_MODE == 'BE') {
$template = new BackendTemplate('be_wildcard');
$template->wildcard = '### PAGE BREAK ###';
return $template->parse();
}
$manager = new MPFormsFormManager($this->pid);
$this->canGoBack = !$manager->isFirstStep();
return parent::parse($attributes);
}
示例5: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
// Return a wildcard in the back end
if (TL_MODE == 'BE') {
/** @var \BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### E&F GRID: ' . $GLOBALS['TL_LANG']['FFL']['rowStart'][0] . ' ###';
$objTemplate->wildcard .= '<div class="tl_content_right tl_gray m12">(' . $GLOBALS['EUF_GRID_SETTING']['row'] . ')</div>';
return $objTemplate->parse();
}
return parent::parse($arrAttributes);
}
示例6: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
// Return a wildcard in the back end
if (TL_MODE == 'BE') {
/** @var \BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_wildcard');
if ($this->fsType == 'fsStart') {
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['tl_form_field']['fsStart'][0]) . ' ###' . ($this->label ? '<br>' . $this->label : '');
} else {
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['tl_form_field']['fsStop'][0]) . ' ###';
}
return $objTemplate->parse();
}
return parent::parse($arrAttributes);
}
示例7: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
// Return a wildcard in the back end
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
if ($this->successType == 'successStart') {
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['tl_form_field']['successStart'][0]) . ' ###' . ($this->label ? '<br>' . $this->label : '');
} else {
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['tl_form_field']['successStop'][0]) . ' ###';
}
return $objTemplate->parse();
}
// Only tableless forms are supported
if (!$this->tableless) {
return '';
}
return parent::parse($arrAttributes);
}
示例8: parse
public function parse($arrAttributes = null)
{
$this->text = \String::toHtml5($this->text);
return parent::parse($arrAttributes);
}
示例9: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
$strClass = 'select';
if ($this->multiple) {
$this->strName .= '[]';
$strClass = 'multiselect';
} elseif (is_array($this->varValue)) {
$this->varValue = $this->varValue[0];
}
// Chosen
if ($this->chosen) {
$strClass .= ' tl_chosen';
}
// Custom class
if ($this->strClass != '') {
$strClass .= ' ' . $this->strClass;
}
$this->strClass = $strClass;
return parent::parse($arrAttributes);
}
示例10: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
if ($this->imageSubmit && $this->singleSRC != '') {
$objModel = \FilesModel::findByUuid($this->singleSRC);
if ($objModel === null) {
if (!\Validator::isUuid($this->singleSRC)) {
return '<p class="error">' . $GLOBALS['TL_LANG']['ERR']['version2format'] . '</p>';
}
} elseif (is_file(TL_ROOT . '/' . $objModel->path)) {
$this->src = $objModel->path;
}
}
return parent::parse($arrAttributes);
}
示例11: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
$this->confirmLabel = sprintf($GLOBALS['TL_LANG']['MSC']['confirmation'], $this->strLabel);
return parent::parse($arrAttributes);
}
示例12: parse
/**
* Parse the template file and return it as string
*
* @param array $arrAttributes An optional attributes array
*
* @return string The template markup
*/
public function parse($arrAttributes = null)
{
if ($this->imageSubmit && $this->singleSRC != '') {
$objModel = \FilesModel::findByUuid($this->singleSRC);
if ($objModel !== null && is_file(TL_ROOT . '/' . $objModel->path)) {
$this->src = $objModel->path;
}
}
return parent::parse($arrAttributes);
}