本文整理汇总了PHP中tao_helpers_Uri类的典型用法代码示例。如果您正苦于以下问题:PHP tao_helpers_Uri类的具体用法?PHP tao_helpers_Uri怎么用?PHP tao_helpers_Uri使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了tao_helpers_Uri类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: initElements
/**
* (non-PHPdoc)
* @see tao_helpers_form_FormContainer::initElements()
*/
public function initElements()
{
$fileName = '';
$instances = array();
if (isset($this->data['instance'])) {
$instance = $this->data['instance'];
if ($instance instanceof core_kernel_classes_Resource) {
$instances[$instance->getUri()] = $instance->getLabel();
}
} elseif (isset($this->data['class'])) {
$class = $this->data['class'];
if ($class instanceof core_kernel_classes_Class) {
foreach ($class->getInstances() as $instance) {
$instances[$instance->getUri()] = $instance->getLabel();
}
}
} else {
throw new common_Exception('No class nor instance specified for export');
}
$instances = tao_helpers_Uri::encodeArray($instances, tao_helpers_Uri::ENCODE_ARRAY_KEYS);
$descElt = tao_helpers_form_FormFactory::getElement('desc', 'Label');
$descElt->setValue(__('Enables you to export a published delivery'));
$this->form->addElement($descElt);
$instanceElt = tao_helpers_form_FormFactory::getElement('exportInstance', 'Radiobox');
$instanceElt->setDescription(__('Items'));
$instanceElt->setAttribute('checkAll', true);
$instanceElt->setOptions($instances);
$instanceElt->setValue(current(array_keys($instances)));
$this->form->addElement($instanceElt);
$this->form->createGroup('options', __('Export Options'), array('desc', 'filename', 'exportInstance'));
}
开发者ID:nagyist,项目名称:extension-tao-delivery,代码行数:35,代码来源:class.AssemblyExportForm.php
示例2: editCenter
/**
* Edit a Test Center instance
* @return void
*/
public function editCenter()
{
$clazz = $this->getCurrentClass();
$testcenter = $this->getCurrentInstance();
$formContainer = new \tao_actions_form_Instance($clazz, $testcenter);
$myForm = $formContainer->getForm();
if ($myForm->isSubmited()) {
if ($myForm->isValid()) {
$binder = new \tao_models_classes_dataBinding_GenerisFormDataBinder($testcenter);
$testcenter = $binder->bind($myForm->getValues());
$this->setData("selectNode", \tao_helpers_Uri::encode($testcenter->getUri()));
$this->setData('message', __('Test center saved'));
$this->setData('reload', true);
}
}
$memberProperty = new \core_kernel_classes_Property(TestCenterService::PROPERTY_MEMBERS_URI);
$memberForm = \tao_helpers_form_GenerisTreeForm::buildReverseTree($testcenter, $memberProperty);
$memberForm->setData('title', __('Select test takers for the test center'));
$this->setData('memberForm', $memberForm->render());
$groupProperty = new \core_kernel_classes_Property(TestCenterService::PROPERTY_DELIVERY_URI);
$groupForm = \tao_helpers_form_GenerisTreeForm::buildTree($testcenter, $groupProperty);
$groupForm->setData('title', __('Select deliveries available at the test center'));
$this->setData('groupForm', $groupForm->render());
$proctorProperty = new \core_kernel_classes_Property(TestCenterService::PROPERTY_PROCTORS_URI);
$proctorForm = \tao_helpers_form_GenerisTreeForm::buildReverseTree($testcenter, $proctorProperty);
$proctorForm->setData('title', __('Select proctors for the test center'));
$this->setData('proctorForm', $proctorForm->render());
$this->setData('formTitle', __('Edit test center'));
$this->setData('myForm', $myForm->render());
$this->setView('form_test_center.tpl');
}
开发者ID:nagyist,项目名称:extension-tao-testcenter,代码行数:35,代码来源:TestCenter.php
示例3: editInstance
/**
* Show the form to edit an instance, show also a preview of the media
*/
public function editInstance()
{
$clazz = $this->getCurrentClass();
$instance = $this->getCurrentInstance();
$myFormContainer = new editInstanceForm($clazz, $instance);
$myForm = $myFormContainer->getForm();
if ($myForm->isSubmited()) {
if ($myForm->isValid()) {
$values = $myForm->getValues();
// save properties
$binder = new \tao_models_classes_dataBinding_GenerisFormDataBinder($instance);
$instance = $binder->bind($values);
$message = __('Instance saved');
$this->setData('message', $message);
$this->setData('reload', true);
}
}
$this->setData('formTitle', __('Edit Instance'));
$this->setData('myForm', $myForm->render());
$uri = $this->hasRequestParameter('id') ? $this->getRequestParameter('id') : $this->getRequestParameter('uri');
try {
$mediaSource = new MediaSource(array());
$fileInfo = $mediaSource->getFileInfo($uri);
$mimeType = $fileInfo['mime'];
$xml = in_array($mimeType, array('application/xml', 'text/xml'));
$url = \tao_helpers_Uri::url('getFile', 'MediaManager', 'taoMediaManager', array('uri' => $uri));
$this->setData('xml', $xml);
$this->setData('fileurl', $url);
$this->setData('mimeType', $mimeType);
} catch (\tao_models_classes_FileNotFoundException $e) {
$this->setData('error', __('No file found for this media'));
}
$this->setView('form.tpl');
}
开发者ID:nagyist,项目名称:extension-tao-mediamanager,代码行数:37,代码来源:MediaManager.php
示例4: initElements
protected function initElements()
{
parent::initElements();
$labelElt = $this->form->getElement(\tao_helpers_Uri::encode(RDFS_LABEL));
if ($labelElt !== null) {
$labelElt->addAttribute('noLabel', true);
$labelElt->addAttribute('class', 'full-width js-label');
$labelElt->addAttribute('value', '{{label}}');
$labelElt->setName('label');
$labelElt->addValidators(array(\tao_helpers_form_FormFactory::getValidator('NotEmpty')));
$this->form->addElement($labelElt);
}
$maxExecElt = $this->form->getElement(\tao_helpers_Uri::encode(TAO_DELIVERY_MAXEXEC_PROP));
if ($maxExecElt !== null) {
$maxExecElt->addValidators(array(\tao_helpers_form_FormFactory::getValidator('Integer', array('min' => 1))));
$maxExecElt->addAttribute('value', '{{maxexec}}');
$maxExecElt->addAttribute('noLabel', true);
$maxExecElt->setName('maxexec');
$maxExecElt->addAttribute('class', 'full-width js-maxexec');
$this->form->addElement($maxExecElt);
}
$resultServerElt = $this->form->getElement(\tao_helpers_Uri::encode(TAO_DELIVERY_RESULTSERVER_PROP));
if ($resultServerElt !== null) {
$resultServerElt->addAttribute('noLabel', true);
$resultServerElt->addAttribute('class', 'full-width');
$resultServerElt->setName('resultserver');
$resultServerElt->addValidators(array(\tao_helpers_form_FormFactory::getValidator('NotEmpty')));
$this->form->addElement($resultServerElt);
}
$recurrenceRuleElt = $this->form->getElement(\tao_helpers_Uri::encode(DeliveryScheduleService::TAO_DELIVERY_RRULE_PROP));
if ($recurrenceRuleElt !== null) {
$recurrenceRuleElt->setName('rrule');
$this->form->addElement($recurrenceRuleElt);
}
}
开发者ID:oat-sa,项目名称:extension-tao-delivery-schedule,代码行数:35,代码来源:EditDeliveryForm.php
示例5: getData
public function getData()
{
if (!tao_helpers_Request::isAjax()) {
throw new common_exception_IsAjaxAction(__FUNCTION__);
}
if ($this->hasRequestParameter('classUri')) {
$classUri = tao_helpers_Uri::decode($this->getRequestParameter('classUri'));
$class = new core_kernel_classes_Class($classUri);
$hideNode = true;
} elseif ($this->hasRequestParameter('rootNode')) {
$class = new core_kernel_classes_Class($this->getRequestParameter('rootNode'));
$hideNode = false;
} else {
throw new common_Exception('Missing node information for ' . __FUNCTION__);
}
$openNodes = array($class->getUri());
if ($this->hasRequestParameter('openNodes') && is_array($this->getRequestParameter('openNodes'))) {
$openNodes = array_merge($openNodes, $this->getRequestParameter('openNodes'));
}
$limit = $this->hasRequestParameter('limit') ? $this->getRequestParameter('limit') : self::DEFAULT_LIMIT;
$offset = $this->hasRequestParameter('offset') ? $this->getRequestParameter('offset') : 0;
$showInst = $this->hasRequestParameter('hideInstances') ? !$this->getRequestParameter('hideInstances') : true;
$factory = new tao_models_classes_GenerisTreeFactory();
$array = $factory->buildTree($class, $showInst, $openNodes, $limit, $offset);
if ($hideNode) {
$array = isset($array['children']) ? $array['children'] : array();
}
echo json_encode($array);
}
开发者ID:nagyist,项目名称:tao-core,代码行数:29,代码来源:class.GenerisTree.php
示例6: files
/**
* Returns a json encoded array describign a directory
*
* @throws common_exception_MissingParameter
* @return string
*/
public function files()
{
if (!$this->hasRequestParameter('uri')) {
throw new common_exception_MissingParameter('uri', __METHOD__);
}
$itemUri = $this->getRequestParameter('uri');
$item = new core_kernel_classes_Resource($itemUri);
if (!$this->hasRequestParameter('lang')) {
throw new common_exception_MissingParameter('lang', __METHOD__);
}
$itemLang = $this->getRequestParameter('lang');
//build filters
$filters = array();
if ($this->hasRequestParameter('filters')) {
$filterParameter = $this->getRequestParameter('filters');
if (!empty($filterParameter)) {
if (preg_match('/\\/\\*/', $filterParameter)) {
common_Logger::w('Stars mime type are not yet supported, filter "' . $filterParameter . '" will fail');
}
$filters = array_map('trim', explode(',', $filterParameter));
}
}
$depth = $this->hasRequestParameter('depth') ? $this->getRequestParameter('depth') : 1;
$resolver = new ItemMediaResolver($item, $itemLang);
$asset = $resolver->resolve($this->getRequestParameter('path'));
$data = $asset->getMediaSource()->getDirectory($asset->getMediaIdentifier(), $filters, $depth);
foreach ($data['children'] as &$child) {
if (isset($child['parent'])) {
$child['url'] = \tao_helpers_Uri::url('files', 'ItemContent', 'taoItems', array('uri' => $itemUri, 'lang' => $itemLang, '1' => $child['parent']));
unset($child['parent']);
}
}
$this->returnJson($data);
}
开发者ID:nagyist,项目名称:tao-extension-tao-item,代码行数:40,代码来源:class.ItemContent.php
示例7: initElements
/**
* Short description of method initElements
*
* @access public
* @author Joel Bout, <[email protected]>
* @return mixed
*/
public function initElements()
{
parent::initElements();
$codeElt = $this->form->getElement(tao_helpers_Uri::encode(PROPERTY_PROCESSVARIABLES_CODE));
$codeElt->addValidator(tao_helpers_form_FormFactory::getValidator('NotEmpty'));
$codeElt->addValidator(new wfAuthoring_actions_form_validators_VariableCode(array('uri' => $this->getInstance()->getUri())));
}
开发者ID:oat-sa,项目名称:extension-tao-wfauthoring,代码行数:14,代码来源:class.InstanceProcessVariable.php
示例8: initElements
/**
* Short description of method initElements
*
* @access protected
* @author Joel Bout, <[email protected]>
* @return mixed
*/
protected function initElements()
{
$langService = tao_models_classes_LanguageService::singleton();
// Retrieve languages available for a GUI usage.
$guiUsage = new core_kernel_classes_Resource(INSTANCE_LANGUAGE_USAGE_GUI);
$guiOptions = array();
foreach ($langService->getAvailableLanguagesByUsage($guiUsage) as $lang) {
$guiOptions[tao_helpers_Uri::encode($lang->getUri())] = $lang->getLabel();
}
// Retrieve languages available for a Data usage.
$dataUsage = new core_kernel_classes_Resource(INSTANCE_LANGUAGE_USAGE_DATA);
$dataOptions = array();
foreach ($langService->getAvailableLanguagesByUsage($dataUsage) as $lang) {
$dataOptions[tao_helpers_Uri::encode($lang->getUri())] = $lang->getLabel();
}
$uiLangElement = tao_helpers_form_FormFactory::getElement('ui_lang', 'Combobox');
$uiLangElement->setDescription(__('Interface language'));
$uiLangElement->setOptions($guiOptions);
$this->form->addElement($uiLangElement);
$dataLangElement = tao_helpers_form_FormFactory::getElement('data_lang', 'Combobox');
$dataLangElement->setDescription(__('Data language'));
$dataLangElement->setOptions($dataOptions);
$this->form->addElement($dataLangElement);
$tzElement = tao_helpers_form_FormFactory::getElement('timezone', 'Combobox');
$tzElement->setDescription(__('Time zone'));
$options = array();
foreach (DateTimeZone::listIdentifiers() as $id) {
$options[$id] = $id;
}
$tzElement->setOptions($options);
$this->form->addElement($tzElement);
}
开发者ID:nagyist,项目名称:tao-core,代码行数:39,代码来源:class.UserSettings.php
示例9: editInstance
public function editInstance()
{
$clazz = $this->getCurrentClass();
$instance = $this->getCurrentInstance();
$myFormContainer = new \tao_actions_form_Instance($clazz, $instance);
$myForm = $myFormContainer->getForm();
$nameElement = $myForm->getElement(\tao_helpers_Uri::encode(WebBrowserService::PROPERTY_NAME));
$versionElement = $myForm->getElement(\tao_helpers_Uri::encode(WebBrowserService::PROPERTY_VERSION));
$nameElement->addClass('select2');
$versionElement->setHelp("<span class=\"icon-help tooltipstered\" data-tooltip=\".web-browser-form .browser-version-tooltip-content\" data-tooltip-theme=\"info\"></span>");
if ($myForm->isSubmited()) {
if ($myForm->isValid()) {
$values = $myForm->getValues();
// save properties
$binder = new \tao_models_classes_dataBinding_GenerisFormDataBinder($instance);
$instance = $binder->bind($values);
$message = __('Instance saved');
$this->setData('message', $message);
$this->setData('reload', true);
}
}
$this->setData('formTitle', __('Edit Authorized Web Browser'));
$this->setData('myForm', $myForm->render());
$this->setView('WebBrowsers/form.tpl');
}
开发者ID:oat-sa,项目名称:extension-tao-client-restrict,代码行数:25,代码来源:WebBrowsers.php
示例10: getAuthoring
/**
* @deprecated
* @see taoTests_models_classes_TestModel::getAuthoring()
*/
public function getAuthoring(core_kernel_classes_Resource $test)
{
$ext = common_ext_ExtensionsManager::singleton()->getExtensionById('taoWfTest');
$testService = taoTests_models_classes_TestsService::singleton();
$itemSequence = array();
$itemUris = array();
$i = 1;
foreach ($testService->getTestItems($test) as $item) {
$itemUris[] = $item->getUri();
$itemSequence[$i] = array('uri' => tao_helpers_Uri::encode($item->getUri()), 'label' => $item->getLabel());
$i++;
}
// data for item sequence, terrible solution
// @todo implement an ajax request for labels or pass from tree to sequence
$allItems = array();
foreach ($testService->getAllItems() as $itemUri => $itemLabel) {
$allItems['item_' . tao_helpers_Uri::encode($itemUri)] = $itemLabel;
}
$widget = new Renderer($ext->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
$widget->setData('uri', $test->getUri());
$widget->setData('allItems', json_encode($allItems));
$widget->setData('itemSequence', $itemSequence);
// data for generis tree form
$widget->setData('relatedItems', json_encode(tao_helpers_Uri::encodeArray($itemUris)));
$openNodes = tao_models_classes_GenerisTreeFactory::getNodesToOpen($itemUris, new core_kernel_classes_Class(TAO_ITEM_CLASS));
$widget->setData('itemRootNode', TAO_ITEM_CLASS);
$widget->setData('itemOpenNodes', $openNodes);
$widget->setData('saveUrl', _url('saveItems', 'Authoring', 'taoWfTest'));
return $widget->render();
}
开发者ID:nagyist,项目名称:extension-tao-testwf,代码行数:34,代码来源:class.WfTestModel.php
示例11: initElements
protected function initElements()
{
$title = tao_helpers_form_FormFactory::getElement('title', 'Free');
$title->setValue('<h2>' . $this->convert('Create and authorize a proctor to the selected test sites') . '</h2>');
$this->form->addElement($title);
parent::initElements();
$this->form->removeElement(\tao_helpers_Uri::encode(PROPERTY_USER_ROLES));
}
开发者ID:oat-sa,项目名称:extension-tao-proctoring,代码行数:8,代码来源:AddProctor.php
示例12: save
/**
*
* @author Lionel Lecaque, [email protected]
*/
public function save()
{
$saved = false;
$instance = $this->getCurrentInstance();
$testUri = tao_helpers_Uri::decode($this->getRequestParameter(tao_helpers_Uri::encode(PROPERTY_DELIVERYCONTENT_TEST)));
$saved = $this->contentModel->addTest($instance, new core_kernel_classes_Resource($testUri));
//$saved = $instance->editPropertyValues(new core_kernel_classes_Property(PROPERTY_DELIVERYCONTENT_TEST ), $testUri);
echo json_encode(array('saved' => $saved));
}
开发者ID:nagyist,项目名称:extension-tao-deliverysimple,代码行数:13,代码来源:class.Authoring.php
示例13: feed
/**
* Short description of method feed
*
* @access public
* @author Joel Bout, <[email protected]>
* @return mixed
*/
public function feed()
{
$expression = "/^" . preg_quote($this->name, "/") . "(.)*[0-9]+\$/";
$this->setValues(array());
foreach ($_POST as $key => $value) {
if (preg_match($expression, $key)) {
$this->addValue(tao_helpers_Uri::decode($value));
}
}
}
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:17,代码来源:class.Checkbox.php
示例14: initDeliveryExecution
public function initDeliveryExecution()
{
$compiledDelivery = new core_kernel_classes_Resource(tao_helpers_Uri::decode($this->getRequestParameter('uri')));
$user = common_session_SessionManager::getSession()->getUser();
if ($this->service->isDeliveryExecutionAllowed($compiledDelivery, $user)) {
$deliveryExecution = $this->executionService->initDeliveryExecution($compiledDelivery, $user->getIdentifier());
} else {
common_Logger::i('Testtaker ' . $user->getIdentifier() . ' not authorised to initialise delivery ' . $compiledDelivery->getUri());
return $this->returnError(__('You are no longer allowed to take the test %s', $compiledDelivery->getLabel()), true);
}
$this->redirect(_url('runDeliveryExecution', null, null, array('deliveryExecution' => $deliveryExecution->getIdentifier())));
}
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:12,代码来源:class.DeliveryServer.php
示例15: getValues
/**
* Short description of method getValues
*
* @access public
* @author Bertrand Chevrier, <[email protected]>
* @param string groupName
* @return array
*/
public function getValues($groupName = '')
{
$returnValue = array();
foreach ($this->elements as $element) {
if (empty($groupName) || !isset($this->groups[$groupName]) || in_array($element->getName(), $this->groups[$groupName]['elements'])) {
$returnValue[tao_helpers_Uri::decode($element->getName())] = $element->getEvaluatedValue();
}
}
unset($returnValue['uri']);
unset($returnValue['classUri']);
return (array) $returnValue;
}
开发者ID:nagyist,项目名称:tao-core,代码行数:20,代码来源:class.Form.php
示例16: initElements
/**
* Initialize the form elements
*
* @access protected
* @author Bertrand Chevrier, <[email protected]>
* @return mixed
*/
protected function initElements()
{
$chainingElt = tao_helpers_form_FormFactory::getElement('chaining', 'Radiobox');
$chainingElt->setDescription(__('Filtering mode'));
$chainingElt->setOptions(array('or' => __('Exclusive (OR)'), 'and' => __('Inclusive (AND)')));
$chainingElt->setValue('or');
$this->form->addElement($chainingElt);
$recursiveElt = tao_helpers_form_FormFactory::getElement('recursive', 'Checkbox');
$recursiveElt->setDescription(__('Scope'));
$recursiveElt->setOptions(array('0' => __('Search sub-classes')));
$this->form->addElement($recursiveElt);
$searchClassUriElt = tao_helpers_form_FormFactory::getElement("clazzUri", "Hidden");
$searchClassUriElt->setValue(tao_helpers_Uri::encode($this->clazz->getUri()));
$this->form->addElement($searchClassUriElt);
$langElt = tao_helpers_form_FormFactory::getElement('lang', 'Combobox');
$langElt->setDescription(__('Language'));
$languages = array_merge(array('-- any --'), tao_helpers_I18n::getAvailableLangsByUsage(new core_kernel_classes_Resource(INSTANCE_LANGUAGE_USAGE_DATA)));
$langElt->setOptions($languages);
$langElt->setValue(0);
$this->form->addElement($langElt);
$this->form->createGroup('params', __('<del>Options</del>'), array('chaining', 'recursive', 'lang'));
$filters = array();
$defaultProperties = tao_helpers_form_GenerisFormFactory::getDefaultProperties();
$classProperties = $this->getClassProperties();
$properties = array_merge($defaultProperties, $classProperties);
isset($this->options['recursive']) ? $recursive = $this->options['recursive'] : ($recursive = false);
if ($recursive) {
foreach ($this->clazz->getSubClasses(true) as $subClass) {
$properties = array_merge($subClass->getProperties(false), $properties);
}
}
foreach ($properties as $property) {
$element = tao_helpers_form_GenerisFormFactory::elementMap($property);
if (!is_null($element) && !$element instanceof tao_helpers_form_elements_Authoring && !$element instanceof tao_helpers_form_elements_Hiddenbox && !$element instanceof tao_helpers_form_elements_Hidden) {
if ($element instanceof tao_helpers_form_elements_MultipleElement) {
$newElement = tao_helpers_form_FormFactory::getElement($element->getName(), 'Checkbox');
$newElement->setDescription($element->getDescription());
$newElement->setOptions($element->getOptions());
$element = $newElement;
}
if ($element instanceof tao_helpers_form_elements_Htmlarea) {
$newElement = tao_helpers_form_FormFactory::getElement($element->getName(), 'Textarea');
$newElement->setDescription($element->getDescription());
$element = $newElement;
}
$this->form->addElement($element);
$filters[] = $element->getName();
}
}
$this->form->createGroup('filters', __('<del>Filters</del>'), $filters);
}
开发者ID:nagyist,项目名称:tao-core,代码行数:58,代码来源:class.Search.php
示例17: initElements
/**
* Initialize the form elements
*
* @access protected
* @author Bertrand Chevrier, <[email protected]>
* @return mixed
*/
protected function initElements()
{
parent::initElements();
$elements = $this->form->getElements();
$this->form->setElements(array());
$currentLangElt = tao_helpers_form_FormFactory::getElement('current_lang', 'Textbox');
$currentLangElt->setDescription(__('Current language'));
$currentLangElt->setAttributes(array('readonly' => 'true'));
$currentLangElt->setValue(\common_session_SessionManager::getSession()->getDataLanguage());
//API lang /data lang
$this->form->addElement($currentLangElt);
$dataLangElement = tao_helpers_form_FormFactory::getElement('translate_lang', 'Combobox');
$dataLangElement->setDescription(__('Translate to'));
$dataLangElement->setOptions(tao_helpers_I18n::getAvailableLangsByUsage(new core_kernel_classes_Resource(INSTANCE_LANGUAGE_USAGE_DATA)));
$dataLangElement->setEmptyOption(__('Select a language'));
$dataLangElement->addValidator(tao_helpers_form_FormFactory::getValidator('NotEmpty'));
$this->form->addElement($dataLangElement);
$this->form->createGroup('translation_info', __('Translation parameters'), array('current_lang', 'translate_lang'));
$dataGroup = array();
foreach ($elements as $element) {
if ($element instanceof tao_helpers_form_elements_Hidden || $element->getName() == 'uri' || $element->getName() == 'classUri') {
$this->form->addElement($element);
} else {
$propertyUri = tao_helpers_Uri::decode($element->getName());
$property = new core_kernel_classes_Property($propertyUri);
//translate only language dependent properties or Labels
//supported widget are: Textbox, TextArea, HtmlArea
//@todo support other widgets
if ($property->isLgDependent() && ($element instanceof tao_helpers_form_elements_Textbox || $element instanceof tao_helpers_form_elements_TextArea || $element instanceof tao_helpers_form_elements_HtmlArea) || $propertyUri == RDFS_LABEL) {
$translatedElt = clone $element;
$viewElt = tao_helpers_form_FormFactory::getElement('view_' . $element->getName(), 'Label');
$viewElt->setDescription($element->getDescription());
$viewElt->setValue($element->getValue());
$viewElt->setAttribute('no-format', true);
if ($element instanceof tao_helpers_form_elements_HtmlArea) {
$viewElt->setAttribute('htmlentities', false);
}
$this->form->addElement($viewElt);
$dataGroup[] = $viewElt->getName();
$translatedElt->setDescription(' ');
$translatedElt->setValue('');
if ($propertyUri == RDFS_LABEL) {
$translatedElt->setForcedValid();
}
$this->form->addElement($translatedElt);
$dataGroup[] = $translatedElt->getName();
}
}
}
$this->form->createGroup('translation_form', __('Translate'), $dataGroup);
}
开发者ID:nagyist,项目名称:tao-core,代码行数:58,代码来源:class.Translate.php
示例18: getCurrentResource
/**
* Return the currently viewing resource
*
* @return \core_kernel_classes_Resource
*/
private function getCurrentResource()
{
if ($this->hasRequestParameter('uri')) {
$uri = $this->getRequestParameter('uri');
if (preg_match('/^i[0-9]+$/', $uri)) {
$uri = LOCAL_NAMESPACE . '#' . $uri;
} elseif (substr($uri, 0, 7) == 'http_2_') {
$uri = \tao_helpers_Uri::decode($uri);
}
} else {
$uri = TAO_OBJECT_CLASS;
}
return new \core_kernel_classes_Resource($uri);
}
开发者ID:nagyist,项目名称:extension-tao-ontobrowser,代码行数:19,代码来源:Browse.php
示例19: index
/**
* render the main layout
*/
public function index()
{
$uri = tao_helpers_Uri::decode($this->getRequestParameter('uri'));
$links = array();
$class = new core_kernel_classes_Class(CLASS_LTI_CONSUMER);
foreach ($class->getInstances() as $consumer) {
$links[] = array('key' => $consumer->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_OAUTH_KEY)), 'secret' => $consumer->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_OAUTH_SECRET)), 'url' => $this->service->getLaunchUrl(array('delivery' => $uri)));
}
$this->setData('links', $links);
$this->setData('launchUrl', $this->service->getLaunchUrl(array('delivery' => $uri)));
$this->setData('consumers', $class->getInstances());
$this->setData('delivery', $uri);
$this->setView('linkManagement.tpl', 'taoLti');
}
开发者ID:nagyist,项目名称:extension-tao-lti,代码行数:17,代码来源:class.LinkManagement.php
示例20: index
/**
* @requiresRight uri READ
*/
public function index()
{
$item = new core_kernel_classes_Resource(tao_helpers_Uri::decode($this->getRequestParameter('uri')));
$itemService = taoItems_models_classes_ItemsService::singleton();
if ($itemService->hasItemContent($item) && $itemService->isItemModelDefined($item)) {
//this is this url that will contains the preview
//@see taoItems_actions_LegacyPreviewApi
$previewUrl = $this->getPreviewUrl($item);
$this->setData('previewUrl', $previewUrl);
$this->setData('client_config_url', $this->getClientConfigUrl());
$this->setData('resultServer', $this->getResultServer());
}
$this->setView('ItemPreview/index.tpl', 'taoItems');
}
开发者ID:oat-sa,项目名称:extension-tao-item,代码行数:17,代码来源:class.ItemPreview.php
注:本文中的tao_helpers_Uri类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论