/** * {@inheritdoc} */ public function valueToWidget($varValue) { if ($this->get('trim_title') && is_array($varValue)) { $varValue = $varValue[1]; } return parent::valueToWidget($varValue); }
/** * {@inheritdoc} */ public function valueToWidget($varValue) { if ($this->get('trim_title') && is_array($varValue)) { $varValue = $varValue[1]; } if ($varValue === null) { $varValue = $this->get('trim_title') ? null : array(0 => '', 1 => ''); } return parent::valueToWidget($varValue); }
/** * {@inheritdoc} */ public function valueToWidget($varValue) { $insertTag = array('{{link_url::', '}}'); $varValue = str_replace($insertTag, '', $varValue); // Define the current ID. // $strTable = $this->getMetaModel()->get('tableName'); // $intId = explode('::',\Input::get('id')); // //var_dump( $intId[1]); // $dc = new DC_General($strTable); // $environment = $dc->getEnvironment(); // $dispatcher = $GLOBALS['container']['event-dispatcher']; // $translator = new TranslatorChain(); // $translator->add(new LangArrayTranslator($dispatcher)); // $factory = new DcGeneralFactory(); // $this->itemContainer = $factory // ->setContainerName($strTable) // ->setTranslator($translator) // ->setEventDispatcher($environment->getEventDispatcher()) // ->createDcGeneral(); // $DataContainer = new DcCompat($this->itemContainer->getEnvironment()); // //get the page model to get the current title and alias to set it to the category // //var_dump($varValue,\Input::get('page')); // $pageModel = \PageModel::findById($varValue); // $DataProvider = $this->itemContainer->getEnvironment()->getDataProvider(); // $model = $DataProvider->fetch($DataProvider->getEmptyConfig()->setId($intId[1])); // // $ProbNameArr = $model->getItem()->get('name'); // $model->setProperty('name',$pageModel->title); // $model->setProperty('alias',$pageModel->alias); // $model->getItem()->save(); return parent::valueToWidget($varValue); }