/** {@inheritdoc} */ public function view($renderer, $saveHandler = '') { $value = $this->value(); if ($value === ' ') { $value = ''; } return $renderer->view($this->defaultView)->set('uploadController', url_build(preg_replace('/(_\\d+)/', '', $renderer->id()), 'upload'))->set('deleteController', url_build(preg_replace('/(_\\d+)/', '', $renderer->id()), 'delete'))->set('getParams', '?f=' . $this->param . '&e=' . $this->entity . '&i=' . $this->dbObject->id)->set('value', $this->value())->output(); }
/** * Function to render class * * @param Application $renderer Renderer object * @param string $saveHandler Save controller name * @return string HTML string */ public function view($renderer, $saveHandler = 'save') { // Current value from DB $value = $this->value(); // Checked for default value $defaultValue = $value == 'http://' || $value == '' ? true : false; return $renderer->view($this->defaultView)->set('cssClass', $this->cssClass)->set('value', $value)->set('defaultValue', $defaultValue)->set('action', url_build(preg_replace('/(_\\d+)/', '', $renderer->id()), $saveHandler))->set('clearFieldController', url_build(preg_replace('/(_\\d+)/', '', $renderer->id()), 'clearField'))->set('paramController', '?e=' . $this->entity . '&p=' . $this->param . '&i=' . $this->dbObject->id)->set('textInput', t('Введите значение начиная с http://', true))->set('textClearConfirm', t('Очистить поле?', true))->set('entity', $this->entity)->set('param', $this->param)->set('objectId', $this->dbObject->id)->set('applicationId', $renderer->id())->set('fieldView', $this->viewField($renderer))->output(); }
/** * Render collection entity field inner block * @param RenderInterface $renderer * @param QueryInterface $query * @param mixed $object Entity object instance * @return string Rendered entity field */ public function render(RenderInterface $renderer, QueryInterface $query, $object) { /** @var \samson\activerecord\structure $structure Material structures list */ $html = array(); if (isset($object->onetomany['_structure'])) { foreach ($object->onetomany['_structure'] as $structure) { $html[] = '<a class="inner" title="' . t('Перейти к материалам ЭСС', true) . '" href="' . url_build($renderer->id(), $structure->id) . '">' . $structure->Name . '</a>'; } } // Render input field view return $renderer->view($this->innerView)->set($this->css, 'class')->set($object, 'item')->set(implode(', ', $html), 'navigation')->output(); }
/** {@inheritdoc} */ public function renderItem($item) { /** @var string $structureHTML HTML representation of material structures */ $structureHTML = ''; /** @var string $search Search string */ $search = empty($this->search) ? '0' : $this->search[0]; /** @var int|string $navigation Filter navigation identifier */ $navigation = count($this->navigation) == 1 && count($this->navigation[0]) == 1 ? $this->navigation[0][0] : '0'; /** @var \samson\activerecord\structure $structure Material structures list */ foreach ($item->onetomany['_structure'] as $structure) { $structureHTML .= '<a class="inner" title="' . t('Перейти к материалам ЭСС', true) . '" href="' . url_build($this->renderer->id(), $structure->id) . '">' . $structure->Name . '</a> '; } // Return item HTML return $this->renderer->view($this->itemView)->set($item, 'item')->set(isset($item->onetoone['_user']) ? $item->onetoone['_user'] : array(), 'user')->set('structures', $structureHTML)->set('currentPage', $this->pager->current_page)->set('search', $search)->set('navigation', $navigation)->output(); }
/** * Render checkboxes selection list * @param array $availableValues Collection of available entities for selection * @param array $selectedValueIDs Collection of selected entity identifiers * @param string $controller Select/Un-select controller action route * @param string $showField Entity field name for showing * @return string HTML rendered checkboxes list */ public function renderList(array $availableValues, array $selectedValueIDs, $controller, $showField = 'Description') { // Iterate all available values $html = ''; foreach ($availableValues as $availableValue) { // Define if this value is selected $checked = in_array($availableValue->id, $selectedValueIDs) ? 'checked' : ''; // Translate all fields $finishTranslateParts = $this->translateCustomFields($availableValue->{$showField}); $html .= '<div class="input-container select-checkboxes-list-item">'; // Render checkbox with label $html .= '<label><input type="checkbox" ' . $checked . ' href="' . url_build($controller, $availableValue->id) . '" value="' . $availableValue->id . '">' . $finishTranslateParts . '</label>'; $html .= '</div>'; } return $html; }
/** {@inheritdoc} */ public function view($renderer, $saveHandler = '') { /** @var \samson\activerecord\material $material Additional field material */ $material = null; $structure = isset($this->dbObject->FieldID) && dbQuery('field')->cond('FieldID', $this->dbObject->FieldID)->first($field) ? intval($field->Value) : 0; $renderer->view($this->defaultView)->set('deleteController', url_build($renderer->id(), 'delete'))->set('getParams', '?f=' . $this->param . '&e=' . $this->entity . '&i=' . $this->dbObject->id); if ((int) $this->value() != 0) { // If material exists if (!$this->dbQuery->className('material')->cond('MaterialID', $this->value())->first($material)) { $renderer->set('material_Name', t('Данный материал не существует! Выберите новый!', true)); } else { $renderer->set($material, 'material'); } } return $renderer->set('parentID', $structure)->output(); }
public function __async_confirm($materialId) { $name = null; if (dbQuery('material')->cond('MaterialID', $materialId)->fields('Name', $name)) { $name = $name[0]; /** @var \samson\activerecord\materialfield $field Materialfield object to store material id */ $this->createField(new dbQuery(), $_GET['e'], $_GET['f'], $_GET['i']); $this->field->save($materialId); return array('status' => true, 'material' => $name, 'url' => url_build($this->id, $materialId)); } return array('status' => false); }
public function __construct($treeTemplate = 'tree/template', $recursion = 1, $asyncController = '') { $this->treeTemplate = $treeTemplate; $this->recursion = $recursion; $this->controller = url_build($asyncController); }
/** * Function to render class * * @param Application $renderer Renderer object * @param string $saveHandler Save controller name * @return string HTML string */ public function view($renderer, $saveHandler = 'save') { // TODO: Context rewriting if in one chain! $fieldView = $this->viewField($renderer); return $renderer->view($this->defaultView)->set($this->cssClass, 'cssClass')->set($this->value(), 'value')->set(url_build(preg_replace('/(_\\d+)/', '', $renderer->id()), $saveHandler), 'action')->set($this->entity, 'entity')->set($this->param, 'param')->set($this->dbObject->id, 'objectId')->set($renderer->id(), 'applicationId')->set($fieldView, 'fieldView')->output(); }
/** * Function to render class * * @param Application $renderer Renderer object * @param string $saveHandler Save controller name * @return string HTML string */ public function view($renderer, $saveHandler = 'save') { return $renderer->view($this->defaultView)->set('cssClass', $this->cssClass)->set('value', $this->value())->set('action', url_build(preg_replace('/(_\\d+)/', '', $renderer->id()), $saveHandler))->set('entity', $this->entity)->set('param', $this->param)->set('objectId', $this->dbObject->id)->set('view', $this->viewField($renderer))->output(); }
/** {@inheritdoc} */ public function view($renderer, $saveHandler = '') { return $renderer->view($this->defaultView)->set('uploadController', url_build($renderer->id(), 'upload'))->set('deleteController', url_build($renderer->id(), 'delete'))->set('getParams', '?f=' . $this->param . '&e=' . $this->entity . '&i=' . $this->dbObject->id)->set('value', $this->value())->output(); }
/** * Create form * @param $Payment Payment * @return string html */ public function createForm($Payment) { return $this->gate->cnb_form(array('version' => '3', 'amount' => $Payment->Amount, 'currency' => $Payment->Currency, 'description' => t("Оплата за заказ - ", true) . ' ' . $Payment->OrderId, 'order_id' => $Payment->OrderId, 'result_url' => $this->resultUrl, 'server_url' => isset($this->serverUrl) ? $this->serverUrl : url_build('liqpay', 'status'), 'sandbox' => $this->sandBox)); }