예제 #1
0
	public function getInput($fieldValue = null)
	{
		$app = JFactory::getApplication();
		if (($app->isSite() && ($this->params->get('hidden_password', 0) == 'frontend' || $this->params->get('hidden_password', 0) == 'both'))
			|| ($app->isAdmin() && ($this->params->get('hidden_password', 0) == 'backend' || $this->params->get('hidden_password', 0) == 'both'))
		)
		{
			$this->setAttribute("type", "password", "input");
		}

		return parent::getInput($fieldValue);
	}
예제 #2
0
	public function storeValue($value, $type = 'default', $inputData = null)
	{
		$updatedField         = new JUDownloadFieldCore_updated(null, $this->doc);
		$DBUpdatedFieldValue  = $updatedField->doc->updated;
		$newUpdatedFieldValue = isset($this->fields_data[$updatedField->id]) ? $this->fields_data[$updatedField->id] : "";

		
		if (!$this->is_new && ($newUpdatedFieldValue == $DBUpdatedFieldValue || $newUpdatedFieldValue == ""))
		{
			
			if ($this->doc->version != $value)
			{
				$date         = JFactory::getDate();
				$updatedValue = $date->toSql();
				$updatedField->storeValue($updatedValue);
			}
		}

		parent::storeValue($value, $type, $inputData);
	}
예제 #3
0
	public function storeValue($value, $type = 'default', $inputData = null)
	{
		
		$aliasField              = new JUDownloadFieldCore_alias(null, $this->doc);
		$aliasField->fields_data = $this->fields_data;
		
		if (($this->is_new && (!$aliasField->canSubmit() || ($aliasField->canSubmit() && $this->fields_data[$aliasField->id] == "")))
			|| (!$this->is_new && (!$aliasField->canEdit() || ($aliasField->canEdit() && $this->fields_data[$aliasField->id] == "")))
		)
		{
			$aliasValue = $aliasField->filterField($value);
			$aliasField->storeValue($aliasValue);
		}

		if (parent::storeValue($value, $type, $inputData))
		{
			
			JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_judownload/tables');
			$tableDocument = JTable::getInstance('Document', 'JUDownloadTable');
			$tableDocument->load($this->doc_id);
			if (isset($tableDocument->asset_id) && $tableDocument->asset_id > 0)
			{
				$db    = JFactory::getDbo();
				$query = $db->getQuery(true);
				$query->update('#__assets');
				$query->set('title =' . $db->quote($value));
				$query->where('id =' . $tableDocument->asset_id);
				$db->setQuery($query);
				$db->execute();
			}
		}
	}