コード例 #1
0
ファイル: _skin.funcs.php プロジェクト: Ariflaw/b2evolution
/**
 * Checks if a skin exists. This can either be a regular skin directory
 * or can be in the list {@link Plugin::GetProvidedSkins()}.
 *
 * Used by front-end.
 *
 * @param skin name (directory name)
 * @return boolean true is exists, false if not
 */
function skin_exists($name, $filename = 'index.main.php')
{
    global $skins_path;
    if (skin_file_exists($name, $filename)) {
        return true;
    }
    // Check list provided by plugins:
    if (skin_provided_by_plugin($name)) {
        return true;
    }
    return false;
}
コード例 #2
0
 /**
  * Instanciate a new object within this cache
  */
 function &new_obj($row = NULL, $skin_folder = NULL)
 {
     if (is_null($skin_folder)) {
         // This happens when using the default skin
         $skin_folder = $row->skin_folder;
     }
     // Check if we have a custom class derived from Skin:
     if (skin_file_exists($skin_folder, '_skin.class.php')) {
         global $skins_path;
         require_once $skins_path . $skin_folder . '/_skin.class.php';
         $objtype = $skin_folder . '_Skin';
         if (!class_exists($objtype)) {
             debug_die('There seems to be a _skin.class.php file in the skin directory [' . $skin_folder . '], but it does not contain a properly named class. Expected class name is: ' . $objtype);
         }
     } else {
         $objtype = 'Skin';
     }
     // Instantiate a custom object
     $obj = new $objtype($row, $skin_folder);
     // COPY !!
     return $obj;
 }