checkImgPath() public method

checks image path for existence - if not found use img from fallback theme
public checkImgPath ( ) : boolean
return boolean
Exemplo n.º 1
0
 /**
  * Test for Theme::checkImgPath
  *
  * @return void
  * @expectedException PHPUnit_Framework_Error
  */
 public function testCheckImgPathGlobalsWrongPath()
 {
     $prevThemePath = $GLOBALS['cfg']['ThemePath'];
     $GLOBALS['cfg']['ThemePath'] = 'no_themes';
     $this->object->setPath('/this/is/wrong/path');
     $this->object->checkImgPath();
     $GLOBALS['cfg']['ThemePath'] = $prevThemePath;
 }
Exemplo n.º 2
0
 /**
  * Test for Theme::checkImgPath
  *
  * @return void
  */
 public function testCheckImgPath()
 {
     $this->object->setPath('./themes/original');
     $this->assertTrue($this->object->checkImgPath());
 }
Exemplo n.º 3
0
 /**
  * returns theme object loaded from given folder
  * or false if theme is invalid
  *
  * @param string $folder path to theme
  *
  * @return Theme|false
  * @static
  * @access public
  */
 public static function load($folder)
 {
     $theme = new Theme();
     $theme->setPath($folder);
     if (!$theme->loadInfo()) {
         return false;
     }
     $theme->checkImgPath();
     return $theme;
 }