コード例 #1
0
 function add_paths($paths)
 {
     // Get views specified in herbert.
     $namespaces = Helper::get('views');
     foreach ($namespaces as $namespace => $views) {
         foreach ((array) $views as $view) {
             // Add to timber $paths array.
             array_unshift($paths, $view);
         }
     }
     return $paths;
 }
 function add_cover()
 {
     \Jigsaw::add_column('pugpig_edition', 'Cover Image', function ($pid) {
         $width = 90;
         $height = 120;
         set_post_thumbnail_size($width, $height);
         $cover_html = get_the_post_thumbnail($pid);
         if (empty($cover_html)) {
             $thumbnail = Helper::assetUrl('/img/no-cover.jpg');
             $cover_html = view('@AgreablePugpigPlugin/cover-column.twig', array('width' => $width, 'height' => $height, 'thumbnail' => $thumbnail))->getBody();
         }
         echo $cover_html;
     });
 }
 public function packager_url($post_id)
 {
     $common_package_vars = array('action' => 'generatepackagefiles', 'p' => $this->linkGenerator->edition_manifest_url($post_id), 'c' => $this->linkGenerator->edition_atom_url($post_id), 'conc' => 3, 'pbp' => '/', 'tf' => PUGPIG_MANIFESTPATH . 'temp/packages/', 'pf' => PUGPIG_MANIFESTPATH . 'packages/', 'urlbase' => 'app/uploads/pugpig-api/packages/');
     $package_url = Helper::pluginDirectory() . "common/pugpig_packager_run.php?";
     return $package_url . http_build_query($common_package_vars);
 }
 public function edition_preview_url($edition_id)
 {
     $base = Helper::pluginDirectory() . "reader/reader.html?atom=";
     $edition_atom_feed = urlencode($this->edition_atom_url($edition_id));
     return $base . $edition_atom_feed;
 }