當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Documents類代碼示例

本文整理匯總了PHP中Documents的典型用法代碼示例。如果您正苦於以下問題:PHP Documents類的具體用法?PHP Documents怎麽用?PHP Documents使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Documents類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bookjsonAction

 public function bookjsonAction()
 {
     Zend_Loader::loadClass("Documents");
     $this->_helper->viewRenderer->setNoRender();
     $requestParams = $this->_request->getParams();
     $IDgazURI = false;
     $uri = false;
     if (isset($requestParams["IDgazURI"])) {
         $IDgazURI = $requestParams["IDgazURI"];
     }
     if (isset($requestParams["uri"])) {
         $uri = $requestParams["uri"];
     }
     $DocObj = new Documents();
     if ($uri != false) {
         Zend_Loader::loadClass("GazetteerRefs");
         $DocObj->getGapVisWithPlaceURI($uri);
     } else {
         $DocObj->getGapVisWithPlaceID($IDgazURI);
     }
     $data = $DocObj->documentData;
     unset($DocObj);
     $output = Zend_Json::encode($data);
     if (isset($requestParams["callback"])) {
         header('Content-Type: application/javascript; charset=utf8');
         $output = $requestParams["callback"] . "(" . $output . ");";
         echo $output;
     } else {
         header('Content-Type: application/json; charset=utf8');
         header("Access-Control-Allow-Origin: *");
         echo $output;
         //outputs JSON of a given book's word cloud
     }
 }
開發者ID:shawngraham,項目名稱:gap2,代碼行數:34,代碼來源:PlacesController.php

示例2: __construct

 public function __construct()
 {
     $groups = new Groups();
     $doc = new Documents();
     /**
      * Wenn gepostet wurde
      */
     if ($_POST) {
         // Gruppe wird erstellt
         if (isset($_POST["group_name"])) {
             $groups->saveGroup($this->saveInputs($_POST["group_name"]), $this->saveInputs($_POST["group_description"]), get_current_user_id());
         }
         // User wird hinzugefügt
         if (isset($_POST["userToAdd"])) {
             $groups->addUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToAdd"]));
         }
         if (isset($_POST["userToDelete"])) {
             $groups->deleteUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToDelete"]));
         }
     }
     // Bestimmte ID wird abgefragt
     if (isset($_GET["id"])) {
         $user = wp_get_current_user();
         $detailGroup = $groups->getGroupAndUsers($this->saveInputs($_GET["id"]));
         $detailGroup->userToAdd = array();
         if ($user->roles[0] == "dokuAdmin" || $user->roles[0] == "administrator") {
             $detailGroup->userToAdd = $groups->getUserNotInGroup($this->saveInputs($_GET["id"]));
         }
         $documentsInGroup = $doc->getDocumentsInGroup($this->saveInputs($_GET["id"]));
         echo $this->detailView($detailGroup, $documentsInGroup);
     } else {
         $arGroups = $groups->getAuthGroups();
         echo $this->groupView($arGroups);
     }
 }
開發者ID:JanUrb,項目名稱:Web-SystemeFL-WP,代碼行數:35,代碼來源:GroupView.php

示例3: doAction

 /**
  * @param $key
  * @param $value
  * @param $context \Workflow\VTEntity
  * @return array|void
  */
 public function doAction($configuration, $filepath, $filename, $context, $targetRecordIds = array())
 {
     $adb = \PearDatabase::getInstance();
     require_once 'modules/Documents/Documents.php';
     $focus = new \Documents();
     $focus->parentid = $context->getId();
     $docTitle = $configuration["title"];
     $docDescr = nl2br($configuration["description"]);
     $docTitle = \Workflow\VTTemplate::parse($docTitle, $context);
     $docDescr = \Workflow\VTTemplate::parse($docDescr, $context);
     $focus->column_fields['notes_title'] = $docTitle;
     $focus->column_fields['assigned_user_id'] = $context->get('assigned_user_id');
     $focus->column_fields['filename'] = $filename;
     $focus->column_fields['notecontent'] = $docDescr;
     $focus->column_fields['filetype'] = 'application/pdf';
     $focus->column_fields['filesize'] = filesize($filepath);
     $focus->column_fields['filelocationtype'] = 'I';
     $focus->column_fields['fileversion'] = '';
     $focus->column_fields['filestatus'] = 'on';
     $focus->column_fields['folderid'] = $configuration["folderid"];
     $focus->save('Documents');
     $upload_file_path = decideFilePath();
     $date_var = date("Y-m-d H:i:s");
     $next_id = $adb->getUniqueID("vtiger_crmentity");
     copy($filepath, $upload_file_path . $next_id . "_" . $filename);
     $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(?, ?, ?, ?, ?, ?, ?)";
     $params1 = array($next_id, $context->get('assigned_user_id'), $context->get('assigned_user_id'), "Documents Attachment", 'Documents Attachment', date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
     $adb->pquery($sql1, $params1);
     $filetype = "application/octet-stream";
     $sql2 = "insert into vtiger_attachments(attachmentsid, name, description, type, path) values(?, ?, ?, ?, ?)";
     $params2 = array($next_id, $filename, $docDescr, $filetype, $upload_file_path);
     $adb->pquery($sql2, $params2, true);
     $sql3 = 'insert into vtiger_seattachmentsrel values(?,?)';
     $adb->pquery($sql3, array($focus->id, $next_id));
     if ($configuration["relation"] === "1") {
         foreach ($targetRecordIds as $id) {
             $sql = "INSERT INTO vtiger_senotesrel SET crmid = " . $id . ", notesid = " . $focus->id;
             $adb->query($sql);
         }
     } else {
         $sql = "DELETE FROM vtiger_senotesrel WHERE crmid = " . $context->getId() . " AND notesid = " . $focus->id;
         $adb->query($sql);
     }
     $newContext = \Workflow\VTEntity::getForId($focus->id, "Documents");
     if ($configuration['workflowid'] !== "") {
         $objWorkflow = new \Workflow\Main($configuration['workflowid'], false, $context->getUser());
         $objWorkflow->setContext($newContext);
         $objWorkflow->isSubWorkflow(true);
         $objWorkflow->start();
     }
 }
開發者ID:cin-system,項目名稱:cinrepo,代碼行數:57,代碼來源:Documents.inc.php

示例4: FindLocalPersonByDoc

 protected function FindLocalPersonByDoc($seria, $number)
 {
     $c = new CDbCriteria();
     if (!(trim($seria) === "")) {
         $c->compare("Series", trim($seria));
     }
     if (!(trim($number) === "")) {
         $c->compare("Numbers", trim($number));
     }
     $models = Documents::model()->findAll($c);
     if (!is_array($models) && is_object($models)) {
         return $models->PersonID;
     }
     foreach ($models as $obj) {
         return $obj->PersonID;
         if ($obj->TypeID == 2) {
             return $obj->PersonID;
         }
         if ($obj->TypeID == 3) {
             return $obj->PersonID;
         }
         if ($obj->TypeID == 4) {
             return $obj->PersonID;
         }
     }
     return 0;
 }
開發者ID:upmunspel,項目名稱:abiturient,代碼行數:27,代碼來源:PersonController.php

示例5: initialize_page

function initialize_page()
{
    $post_action = "";
    if (isset($_POST['submit'])) {
        $post_action = $_POST['submit'];
    }
    if ($post_action == "Add Document" || $post_action == "Add and Return to List") {
        $name = $_POST['name'];
        $file_type = getFileExtension($_FILES['file']['name']);
        $filename = slug(getFileName($_FILES['file']['name']));
        $filename_string = $filename . "." . $file_type;
        // Check to make sure there isn't already a file with that name
        $possibledoc = Documents::FindByFilename($filename_string);
        if (is_object($possibledoc)) {
            setFlash("<h3>Failure: Document filename already exists!</h3>");
            redirect("admin/add_document");
        }
        $target_path = SERVER_DOCUMENTS_ROOT . $filename_string;
        if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
            $new_doc = MyActiveRecord::Create('Documents', array('name' => $name, 'filename' => $filename_string, 'file_type' => $file_type));
            $new_doc->save();
            if (!chmod($target_path, 0644)) {
                setFlash("<h3>Warning: Document Permissions not set; this file may not display properly</h3>");
            }
            setFlash("<h3>Document uploaded</h3>");
        } else {
            setFlash("<h3>Failure: Document could not be uploaded</h3>");
        }
        if ($post_action == "Add and Return to List") {
            redirect("admin/list_documents");
        }
    }
}
開發者ID:highchair,項目名稱:hcd-trunk,代碼行數:33,代碼來源:add_document.php

示例6: direct

 function direct($throw = true)
 {
     $slug = $this->getRequest()->getParam('document');
     $t = new Documents();
     try {
         $d = $t->findBySlug($slug);
     } catch (Strass_Db_Table_NotFound $e) {
         if ($throw) {
             throw new Strass_Controller_Action_Exception_NotFound("Document " . $slug . " inconnu.");
         } else {
             return null;
         }
     }
     $this->setBranche($d);
     return $d;
 }
開發者ID:bersace,項目名稱:strass,代碼行數:16,代碼來源:Document.php

示例7: getDocuments

 /**
  * Return all documents that belong to a category
  *
  * @param void
  * @return array
  */
 function getDocuments()
 {
     if ($this->documents === false) {
         $this->documents = Documents::findByCategory($this);
     }
     // if
     return $this->documents;
 }
開發者ID:NaszvadiG,項目名稱:activecollab_loc,代碼行數:14,代碼來源:DocumentCategory.class.php

示例8: loadDocumentsModel

 public function loadDocumentsModel($id)
 {
     $model = Documents::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
開發者ID:seekermain,項目名稱:forms,代碼行數:8,代碼來源:AjaxController.php

示例9: display_page_content

function display_page_content()
{
    if (!requestIdParam()) {
        $documents = Documents::FindAll("DESC");
    } else {
        $documents = Documents::FindByFiletype(requestIdParam());
    }
    ?>
	
	<div id="edit-header" class="documentnav">
		<div class="nav-left column">
    		<h1>Choose a Document to Edit</h1>
		</div>
		<div class="nav-right column">
            <a href="<?php 
    echo get_link("admin/add_document");
    ?>
" class="hcd_button">Add a New Document</a>
		</div>
		<div class="clearleft"></div>
	</div>
	
	<p class="announce">Documents are defined as downloadable files or forms. PDFs, DOCs, and the like are acceptable. You may use this feature to make high resolution images downloadable as well. If the image is too large to upload, and you get an error, you may want to compress the image with StuffIt (.sit), WinZip (.zip), or ZipIt (.zip).</p>
	
<?php 
    if (count($documents) > 0) {
        ?>
			
	<div id="table-header" class="documents">
		<strong class="item-link">Document Name</strong>
		<span class="item-filename">Filename</span>
		<span class="item-viewlink">View file in new window</span>
	</div>
	
		<?php 
        //$filetypes = Documents::FindUniqueFiletypes();
        if (isset($filetypes) && count($filetypes) > 1) {
            echo "<ul class=\"menu tabs\">\n\t\t<li>Show Only: </li>\n";
            foreach ($filetypes as $type) {
                echo "\t\t<li><a href=\"" . get_link("admin/list_documents/" . $type->file_type) . "\">{$type->file_type}</a></li>\n";
            }
            echo "\t\t<li><a class=\"hcd_button\" href=\"" . get_link("admin/list_documents/") . "\">Show All</a></li>\n\t</ul>\n ";
        }
        ?>
	
	<ul id="listitems" class="managelist">
		<?php 
        foreach ($documents as $document) {
            echo "\t\t<li>\n\t\t\t<span class=\"item-link\"><a href=\"" . get_link("/admin/edit_document/{$document->id}") . "\">{$document->name} <small>EDIT</small></a></span>\n\t\t\t<span class=\"item-filename\">{$document->filename}</span>\n\t\t\t<span class=\"item-viewlink\"><a href=\"" . $document->getPublicUrl() . "\" target=\"_blank\">View file</a></span>\n\t\t</li>\n";
        }
        ?>
	
	</ul>
<?php 
    } else {
        echo "\t\t<h3 class=\"empty-list\">There are no documents to edit. <a class=\"short\" href=\"" . get_link("admin/add_document") . "\">Add one if you like</a>.</h3>";
    }
}
開發者ID:highchair,項目名稱:hcd-trunk,代碼行數:58,代碼來源:list_documents.php

示例10: findFirstAsArray

 public static function findFirstAsArray($id, $pullDocuments = false)
 {
     $p = parent::findFirst($id);
     $p = $p->toArray();
     if ($pullDocuments) {
         $p['documents'] = Documents::findByProjectId($id);
     }
     return $p;
 }
開發者ID:romainroufast,項目名稱:bilionairebikersclub,代碼行數:9,代碼來源:Projects.php

示例11: __construct

 /**
  * Erstellt die Sidebar mit Dokumenten, Gruppen usw.
  */
 public function __construct()
 {
     $docs = new Documents();
     $this->authDocs = $docs->getDocumentsCreatedByUser(get_current_user_id());
     $groups = new Groups();
     $this->authGroups = $groups->getAuthGroups();
     /**
      * SeitenUrl holen
      * @var array
      */
     $pagesFilter = array('post_type' => 'page', 'meta_key' => 'custom_element_grid_class_meta_box', 'meta_value' => 'Gruppen');
     $pages = get_posts($pagesFilter);
     $GroupLink = get_permalink($pages[0]->ID);
     $pagesFilter["meta_value"] = "Dokumente";
     $pages = get_posts($pagesFilter);
     $documentLink = get_permalink($pages[0]->ID);
     $pagesFilter["meta_value"] = "Startseite";
     $pages = get_posts($pagesFilter);
     $homeLink = get_permalink($pages[0]->ID);
     echo $this->view($GroupLink, $documentLink, $homeLink);
 }
開發者ID:JanUrb,項目名稱:Web-SystemeFL-WP,代碼行數:24,代碼來源:Menu_Widget.php

示例12: index

 /**
  * Index page action
  * 
  * @param void
  * @return void
  */
 function index()
 {
     $page = (int) $this->request->get('page');
     if ($page < 1) {
         $page = 1;
     }
     // if
     $per_page = 10;
     list($documents, $pagination) = Documents::paginateDocuments($this->logged_user->getVisibility(), $page, $per_page);
     $this->smarty->assign(array('documents' => $documents, 'pagination' => $pagination));
     js_assign(array('pin_icon_url' => get_image_url('icons/pinned.16x16.gif'), 'unpin_icon_url' => get_image_url('icons/not-pinned.16x16.gif')));
 }
開發者ID:NaszvadiG,項目名稱:activecollab_loc,代碼行數:18,代碼來源:DocumentsController.class.php

示例13: dokumummy_activated

/**
 * Diese Funktions erstellt Rollen und DB-Tables bei der Aktivierung des Plugins im WP-Backend.
 */
function dokumummy_activated()
{
    /**
     * Rolen registrieren
     */
    new RoleSetup();
    /**
     * Seiten erstellen
     */
    new PageSetup();
    /**
     * Datenbanken für Gruppen erstellen
     */
    $groups = new Groups();
    $groups->initDatabase();
    /**
     * Datenbanken für Dokumente erstellen
     */
    $documents = new Documents();
    $documents->initDatabase();
}
開發者ID:JanUrb,項目名稱:Web-SystemeFL-WP,代碼行數:24,代碼來源:Doku-mummy-plugin.php

示例14:

 /**
  * Return parent object
  *
  * @param void
  * @return ApplicationObject
  */
 function &getParent()
 {
     if ($this->parent === false) {
         if (strtolower($this->getParentType()) == 'document') {
             $this->parent = $this->getParentId() ? Documents::findById($this->getParentId()) : null;
         } else {
             $this->parent = $this->getParentId() ? ProjectObjects::findById($this->getParentId()) : null;
         }
         // if
     }
     // if
     return $this->parent;
 }
開發者ID:NaszvadiG,項目名稱:activecollab_loc,代碼行數:19,代碼來源:Attachment.class.php

示例15: alljsonAction

 public function alljsonAction()
 {
     Zend_Loader::loadClass("Documents");
     $this->_helper->viewRenderer->setNoRender();
     $requestParams = $this->_request->getParams();
     $host = App_Config::getHost();
     $DocObj = new Documents();
     $DocObj->getAllComplete();
     $data = $DocObj->documentData;
     unset($DocObj);
     $output = Zend_Json::encode($data);
     if (isset($requestParams["callback"])) {
         header('Content-Type: application/javascript; charset=utf8');
         $output = $requestParams["callback"] . "(" . $output . ");";
         echo $output;
     } else {
         header('Content-Type: application/json; charset=utf8');
         header("Access-Control-Allow-Origin: *");
         echo $output;
         //outputs JSON of a given book's word cloud
     }
 }
開發者ID:shawngraham,項目名稱:gap2,代碼行數:22,代碼來源:BooksController.php


注:本文中的Documents類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。