Best Answer SmetDenis , 25 August 2013 - 04:40
Попробуйте создать новый файл по адресу
media\zoo\applications\jbuniversal\elements\text\text.php
со следующим содержанием
<?php
/**
* @package com_zoo
* @author YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// register ElementRepeatable class
App::getInstance('zoo')->loader->register('ElementRepeatable', 'elements:repeatable/repeatable.php');
/*
Class: ElementText
The text element class
*/
class ElementText extends ElementRepeatable implements iRepeatSubmittable {
/*
Function: _hasValue
Checks if the repeatables element's value is set.
Parameters:
$params - render parameter
Returns:
Boolean - true, on success
*/
protected function _hasValue($params = array()) {
$value = $this->get('value', $this->config->get('default'));
return !empty($value) || $value === '0';
}
/*
Function: _getSearchData
Get repeatable elements search data.
Returns:
String - Search data
*/
protected function _getSearchData() {
return $this->get('value', $this->config->get('default'));
}
/*
Function: _edit
Renders the repeatable edit form field.
Returns:
String - html
*/
protected function _edit() {
return $this->app->html->_('control.text', $this->getControlName('value'), $this->get('value', $this->config->get('default')), 'size="60" maxlength="255"');
}
/*
Function: _renderSubmission
Renders the element in submission.
Parameters:
$params - AppData submission parameters
Returns:
String - html
*/
public function _renderSubmission($params = array()) {
return $this->_edit();
}
public function render($params = array()) {
$params = $this->app->data->create($params);
$result = array();
foreach ($this as $self) {
$html = $this->_render($params);
if (JString::trim($html)) {
$result[] = $this->_render($params);
}
}
return $this->app->element->applySeparators($params->get('separated_by'), $result);
}
}
проверка добавлена в последнем методе.новый файл безопасно переопределит код стандартного элемента, т.е без изменений ядра. Go to the full post


This topic is locked








