当前位置: 首页>>代码示例>>PHP>>正文


PHP JUDownloadHelper::getFieldGroupIdByDocId方法代码示例

本文整理汇总了PHP中JUDownloadHelper::getFieldGroupIdByDocId方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper::getFieldGroupIdByDocId方法的具体用法?PHP JUDownloadHelper::getFieldGroupIdByDocId怎么用?PHP JUDownloadHelper::getFieldGroupIdByDocId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JUDownloadHelper的用法示例。


在下文中一共展示了JUDownloadHelper::getFieldGroupIdByDocId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: copyDocuments


//.........这里部分代码省略.........
                 $table->checkIn();
                 $total_copied_documents++;
             } else {
                 continue;
             }
             $newDocId = $table->id;
             if ($table->icon) {
                 $ori_icon_name = $table->icon;
                 $new_icon_name = $newDocId . substr($ori_icon_name, strpos($ori_icon_name, '_'));
                 $query = "UPDATE #__judownload_documents SET icon = '" . $new_icon_name . "' WHERE id=" . $newDocId;
                 $db->setQuery($query);
                 $db->execute();
                 $icon_directory = JPATH_ROOT . "/" . JUDownloadFrontHelper::getDirectory("document_icon_directory", "media/com_judownload/images/document/");
                 if (JFile::exists($icon_directory . $ori_icon_name)) {
                     JFile::copy($icon_directory . $ori_icon_name, $icon_directory . $new_icon_name);
                 }
                 if (JFile::exists($icon_directory . "original/" . $ori_icon_name)) {
                     JFile::copy($icon_directory . "original/" . $ori_icon_name, $icon_directory . "original/" . $new_icon_name);
                 }
             }
             $query = "INSERT INTO #__judownload_documents_xref (doc_id, cat_id, main) VALUES({$newDocId}, {$tocat_id}, 1)";
             $db->setQuery($query);
             $db->execute();
             $query = "SELECT * FROM #__judownload_tags_xref WHERE doc_id=" . $doc_id . " ORDER BY ordering ASC";
             $db->setQuery($query);
             $tags = $db->loadObjectList();
             if (!empty($tags)) {
                 foreach ($tags as $tag) {
                     $query = "INSERT INTO #__judownload_tags_xref (tag_id, doc_id, ordering) VALUES (" . $tag->tag_id . ", " . $newDocId . ", " . $tag->ordering . ")";
                     $db->setQuery($query);
                     $db->execute();
                 }
             }
             $ori_fieldgroup_id = JUDownloadHelper::getFieldGroupIdByDocId($doc_id);
             $copy_extra_fields = in_array("copy_extra_fields", $copy_option_arr);
             if ($copy_extra_fields) {
                 $copy_extra_fields = $ori_fieldgroup_id == $catTable->fieldgroup_id ? true : false;
             }
             $query = $db->getQuery(true);
             $query->select("field.*");
             $query->from("#__judownload_fields AS field");
             $query->select("plg.folder");
             $query->join("", "#__judownload_plugins AS plg ON field.plugin_id = plg.id");
             if ($copy_extra_fields && $ori_fieldgroup_id) {
                 $query->where("field.group_id IN (1, {$ori_fieldgroup_id})");
             } else {
                 $query->where("field.group_id = 1");
             }
             $db->setQuery($query);
             $fields = $db->loadObjectList();
             foreach ($fields as $field) {
                 $fieldObj = JUDownloadFrontHelperField::getField($field, $doc_id);
                 $fieldObj->onCopy($newDocId, $fieldsData);
             }
             if (in_array('copy_files', $copy_option_arr)) {
                 $query = "SELECT * FROM #__judownload_files WHERE doc_id = " . $doc_id;
                 $db->setQuery($query);
                 $files = $db->loadObjectList();
                 if ($files) {
                     foreach ($files as $file) {
                         $fileTable->reset();
                         if ($fileTable->bind($file) && $fileTable->check()) {
                             $fileTable->id = 0;
                             $fileTable->doc_id = $newDocId;
                             if ($fileTable->store()) {
                                 $filesStoreMap[$file->id] = $fileTable->id;
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:67,代码来源:document.php


注:本文中的JUDownloadHelper::getFieldGroupIdByDocId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。