本文整理汇总了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
}
}
示例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);
}
}
示例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();
}
}
示例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;
}
示例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");
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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>";
}
}
示例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;
}
示例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);
}
示例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')));
}
示例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();
}
示例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;
}
示例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
}
}