コード例 #1
0
ファイル: LibrarianTrait.php プロジェクト: taproot/librarian
 protected function getLibrarian()
 {
     if ($this->librarian !== null) {
         return $this->librarian;
     }
     $l = new Librarian($this->librarianNamespace, ['db' => $this->pdo, 'path' => $this->librarianPath, 'type' => $this->librarianType], $this->getLibrarianIndexes());
     $l->buildEnvironment();
     $this->librarian = $l;
     return $this->librarian;
 }
コード例 #2
0
ファイル: index.php プロジェクト: nathansh/librarian
<?php

// Some basic utility functions
require_once "includes/utility.php";
// Load, instantiate Librarian class
require_once "includes/class.librarian.php";
$Librarian = new Librarian();
// Build the library
$Librarian->make_library();
// Bootstrap the downloader too. Downloads submit to self.
$Librarian->init_downloader();
// Bootstrap the raw viewer for markup
$Librarian->view_raw();
// Load the theme functions
require_once "theme/functions.php";
// Load the theme template file
require_once "theme/index.php";
コード例 #3
0
 /**
  * Deletes a librarian
  *
  * @param string $id
  */
 public function deleteAction($id)
 {
     $librarian = Librarian::findFirstByid($id);
     if (!$librarian) {
         $this->flash->error("librarian was not found");
         return $this->dispatcher->forward(array("controller" => "librarian", "action" => "index"));
     }
     if (!$librarian->delete()) {
         foreach ($librarian->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "librarian", "action" => "search"));
     }
     $this->flash->success("librarian was deleted successfully");
     return $this->dispatcher->forward(array("controller" => "librarian", "action" => "index"));
 }