本文整理汇总了PHP中JUDownloadHelper::getDocumentSubmitType方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper::getDocumentSubmitType方法的具体用法?PHP JUDownloadHelper::getDocumentSubmitType怎么用?PHP JUDownloadHelper::getDocumentSubmitType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDownloadHelper
的用法示例。
在下文中一共展示了JUDownloadHelper::getDocumentSubmitType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInput
public function getInput($fieldValue = null)
{
if (!$this->isPublished())
{
return "";
}
if ((JUDownloadHelper::getDocumentSubmitType($this->doc_id) == 'submit' && $this->canSubmit())
|| (JUDownloadHelper::getDocumentSubmitType($this->doc_id) == 'edit' && $this->canEdit())
)
{
$disabled = false;
}
else
{
$disabled = true;
}
$document = JFactory::getDocument();
$rootCat = JUDownloadFrontHelperCategory::getRootCategory();
JText::script('COM_JUDOWNLOAD_TOTAL_CATS_OVER_MAXIMUM_N_CATS');
JText::script('COM_JUDOWNLOAD_CATEGORY_X_ALREADY_EXIST');
$app = JFactory::getApplication();
if (isset($this->doc) && $this->doc->cat_id)
{
$params = JUDownloadHelper::getParams($this->doc->cat_id);
}
else
{
$params = JUDownloadHelper::getParams(null, $this->doc_id);
}
$db = JFactory::getDbo();
$docId = $this->doc_id;
$documentObject = JUDownloadHelper::getDocumentById($docId);
$secondaryCatIds = $secondaryCatIdsStr = "";
if ($fieldValue && !empty($fieldValue['main']))
{
$categoryId = (int) $fieldValue['main'];
if ($fieldValue['secondary'])
{
$secondaryCatIdsStr = $fieldValue['secondary'];
$secondaryCatIds = explode(",", $secondaryCatIdsStr);
}
$query = $db->getQuery(true);
$query->select("c.id, c.parent_id");
$query->from("#__judownload_categories AS c");
$query->select("field_group.id AS fieldgroup_id, field_group.name AS fieldgroup_name");
$query->join("LEFT", "#__judownload_fields_groups AS field_group ON (field_group.id = c.fieldgroup_id AND field_group.published = 1)");
$query->where("c.id = " . $categoryId);
$db->setQuery($query);
$mainCategory = $db->loadObject();
}
elseif ($docId)
{
$categories = $this->value;
foreach ($categories AS $category)
{
if ($category->main == 1)
{
$mainCategory = $category;
$query = $db->getQuery(true);
$query->select("field_group.id, field_group.name");
$query->from("#__judownload_fields_groups AS field_group");
$query->join("", "#__judownload_categories AS c on c.fieldgroup_id = field_group.id");
$query->where("c.id = " . $mainCategory->id);
$query->where("field_group.published = 1");
$db->setQuery($query);
$fieldGroup = $db->loadObject();
if (is_object($fieldGroup))
{
$mainCategory->fieldgroup_name = $fieldGroup->name;
$mainCategory->fieldgroup_id = $fieldGroup->id;
}
else
{
$mainCategory->fieldgroup_name = null;
$mainCategory->fieldgroup_id = null;
}
}
else
{
$secondaryCatIds[] = $category->id;
}
}
if ($secondaryCatIds)
{
$secondaryCatIdsStr = implode(",", $secondaryCatIds);
}
}
elseif ($app->input->getInt('cat_id'))
{
$categoryId = $app->input->getInt('cat_id');
//.........这里部分代码省略.........