本文整理汇总了PHP中JUDownloadHelper::getTempDocument方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper::getTempDocument方法的具体用法?PHP JUDownloadHelper::getTempDocument怎么用?PHP JUDownloadHelper::getTempDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDownloadHelper
的用法示例。
在下文中一共展示了JUDownloadHelper::getTempDocument方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tpl = null)
{
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode('<br />', $errors));
return false;
}
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->model = $this->getModel();
$this->app = JFactory::getApplication();
$cat_id = $this->item->cat_id ? $this->item->cat_id : $this->app->input->get('cat_id');
$this->params = JUDownloadHelper::getParams(null, $this->item->id);
if ($cat_id == JUDownloadFrontHelperCategory::getRootCategory()->id && !$this->params->get('allow_add_doc_to_root', 0)) {
JError::raiseError(500, JText::_('COM_JUDOWNLOAD_CAN_NOT_ADD_DOCUMENT_TO_ROOT_CATEGORY'));
return false;
}
if ($tempDocument = JUDownloadHelper::getTempDocument($this->item->id)) {
$editPendingDocLink = '<a href="index.php?option=com_judownload&task=document.edit&approve=1&id=' . $tempDocument->id . '">' . $tempDocument->title . '</a>';
JError::raiseNotice('', JText::sprintf('COM_JUDOWNLOAD_THIS_DOCUMENT_HAS_PENDING_DOCUMENT_X_PLEASE_APPROVE_PENDING_DOCUMENT_FIRST', $editPendingDocLink));
}
if ($this->item->approved < 0) {
$oriDocId = abs($this->item->approved);
$oriDocObj = JUDownloadHelper::getDocumentById($oriDocId);
$editOriDocLink = '<a href="index.php?option=com_judownload&task=document.edit&id=' . $oriDocId . '">' . $oriDocObj->title . '</a>';
JError::raiseNotice('', JText::sprintf('COM_JUDOWNLOAD_ORIGINAL_DOCUMENT_X', $editOriDocLink));
}
$this->script = $this->get('Script');
$this->plugins = $this->get('Plugins');
$this->fieldsetDetails = $this->model->getCoreFields('details');
$this->fieldsetPublishing = $this->model->getCoreFields('publishing');
$this->fieldsetTemplateStyleAndLayout = $this->model->getCoreFields('template_style');
$this->fieldsetMetadata = $this->model->getCoreFields('metadata');
$this->fieldCatid = JUDownloadFrontHelperField::getField('cat_id', $this->item);
$this->fieldGallery = JUDownloadFrontHelperField::getField('gallery', $this->item);
$this->files = $this->get('Files');
$this->changeLogs = $this->get('ChangeLogs');
$this->versions = $this->get('Versions');
$this->extraFields = $this->get('ExtraFields');
$this->fieldsData = $this->app->getUserState("com_judownload.edit.document.fieldsdata", array());
$this->relatedDocuments = $this->get('RelatedDocuments');
$this->canDo = JUDownloadHelper::getActions('com_judownload', 'category', $this->item->cat_id);
$this->addToolBar();
$this->setDocument();
parent::display($tpl);
}
示例2: storeValue
public function storeValue($value, $type = 'default', $inputData = null)
{
$app = JFactory::getApplication();
if ($app->isSite())
{
return true;
}
else
{
$tmpDoc = JUDownloadHelper::getTempDocument($this->doc_id);
if (is_object($tmpDoc))
{
return true;
}
$approveOption = $app->input->post->get("approval_option");
$approveOptionArray = array("ignore", "approve", "delete");
if (in_array($approveOption, $approveOptionArray))
{
return true;
}
return parent::storeValue($value, $type, $inputData);
}
}
示例3: htmlspecialchars
}
$text = htmlspecialchars($text, ENT_COMPAT, 'UTF-8');
$this->setAttribute("value", htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8'), "input");
if ($option->value == $value)
{
$this->setAttribute("checked", "checked", "input");
}
else
{
$this->setAttribute("checked", null, "input");
}
$tmpDoc = JUDownloadHelper::getTempDocument($this->doc_id);
if (is_object($tmpDoc))
{
$this->setAttribute("disabled", "disabled", "input");
}
else
{
$this->setAttribute("disabled", null, "input");
if (is_object($this->doc) && $this->doc->approved < 0)
{
$this->setAttribute("disabled", "disabled", "input");
}
}
$html .= "<input id=\"" . $this->getId() . $key . "\" name=\"" . $this->getName() . "\" " . $this->getAttribute(null, null, "input") . " /> <label for=\"" . $this->getId() . $key . "\">$text</label>";
}