Exemplo n.º 1
0
 /**
  * Get image URL to display in web interface
  *
  * @param Series $series Current series
  * @param string $format Format to display
  *
  * @return string
  */
 public function getUrl(Series $series = null, $format = 'default')
 {
     $prefix = $this->_app_base_url . '/show/';
     $prefix .= $format . '/';
     if ($series) {
         $prefix .= $series->getPath() . '/';
     } else {
         if ($this->_path !== null) {
             $prefix .= $this->_path;
         }
     }
     return $prefix . $this->getName();
 }
Exemplo n.º 2
0
 }
 if ($start === null && $end !== null || $start !== null && $end === null) {
     $start = null;
     $end = null;
     throw new \RuntimeException(_('Sub series cannot be instancied; missing one of start or end param!'));
 }
 $series = null;
 try {
     $series = new Series($conf, implode('/', $path), $app_base_url, $start, $end);
 } catch (\RuntimeException $e) {
     Analog::log(_('Cannot load series: ') . $e->getMessage(), Analog::ERROR);
     $app->pass();
 }
 //check if series has content, throw an error if not
 if ($series->getCount() === 0) {
     throw new \RuntimeException(str_replace('%s', $series->getPath(), _('Series "%s" is empty!')));
 }
 $img = null;
 if ($request->params('img') !== null) {
     //get image from its name
     if ($series->setImage($request->params('img'))) {
         $img = $series->getImage();
     }
 } else {
     if ($request->get('num') !== null) {
         //get image from its position
         if ($series->setNumberedImage($request->params('num'))) {
             $img = $series->getImage();
         }
     }
 }