<commit_before><?php
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2013 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*	$Id$                                            *
********************************************************************************************************/

/**
 * A small class providing a few methods handling the admin-skins available
 *
 * @package module_system
 * @author <EMAIL>
 * @since 4.0
 */
class class_adminskin_helper {

    private static $strSkinPath = null;

    /**
     * @var interface_adminskin_imageresolver
     */
    private static $objAdminImageResolver = null;

    /**
     * Returns the list of available admin-skins
     * @static
     * @return array
     */
    public static function getListOfAdminskinsAvailable() {

        $arrFiles = class_resourceloader::getInstance()->getFolderContent("/admin/skins", array(), true);

        $arrReturn = array();
        foreach($arrFiles as $strPath => $strName) {
            if(is_dir(_realpath_.$strPath) && $strName[0] != ".")
                $arrReturn[$strPath] = $strName;
        }

        return $arrReturn;

    }

    /**
     * Loads the file-system path for a single skin
     * @static
     * @param $strSkin
     * @return string
     */
    public static function getPathForSkin($strSkin) {
        if(self::$strSkinPath == null)
            self::$strSkinPath = class_resourceloader::getInstance()->getPathForFolder("/admin/skins/".$strSkin);

        return self::$strSkinPath;
    }

    /**
     * Internal helper, sets the current skinwebpath to be used by skins
     * @static
     */
    public static function defineSkinWebpath() {
        if(!defined("_skinwebpath_"))
            define("_skinwebpath_", _webpath_.self::getPathForSkin(class_carrier::getInstance()->getObjSession()->getAdminSkin()));
    }

    /**
     * Makes use of the admin-skin image-mapper to resolve an image-name into a
     * real image-tag / script / whatever
     *
     * @param $strName
     * @param string $strAlt
     * @param bool $bitBlockTooltip
     * @param string $strEntryId
     *
     * @return string
     */
    public static function getAdminImage($strName, $strAlt = "", $bitBlockTooltip = false, $strEntryId = "") {
        if(self::$objAdminImageResolver == null) {
            include_once _realpath_.self::getPathForSkin(class_carrier::getInstance()->getObjSession()->getAdminSkin())."/class_adminskin_imageresolver.php";
            self::$objAdminImageResolver = new class_adminskin_imageresolver();
        }

        return self::$objAdminImageResolver->getImage($strName, $strAlt, $bitBlockTooltip, $strEntryId);
    }
}

<commit_msg>BUG: error when updating module system<commit_after><?php
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2013 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*	$Id$                                            *
********************************************************************************************************/

/**
 * A small class providing a few methods handling the admin-skins available
 *
 * @package module_system
 * @author <EMAIL>
 * @since 4.0
 */
class class_adminskin_helper {

    private static $strSkinPath = null;

    /**
     * @var interface_adminskin_imageresolver
     */
    private static $objAdminImageResolver = null;

    /**
     * Returns the list of available admin-skins
     * @static
     * @return array
     */
    public static function getListOfAdminskinsAvailable() {

        $arrFiles = class_resourceloader::getInstance()->getFolderContent("/admin/skins", array(), true);

        $arrReturn = array();
        foreach($arrFiles as $strPath => $strName) {
            if(is_dir(_realpath_.$strPath) && $strName[0] != ".")
                $arrReturn[$strPath] = $strName;
        }

        return $arrReturn;

    }

    /**
     * Loads the file-system path for a single skin
     * @static
     * @param $strSkin
     * @return string
     */
    public static function getPathForSkin($strSkin) {
        if(self::$strSkinPath == null)
            self::$strSkinPath = class_resourceloader::getInstance()->getPathForFolder("/admin/skins/".$strSkin);

        return self::$strSkinPath;
    }

    /**
     * Internal helper, sets the current skinwebpath to be used by skins
     * @static
     */
    public static function defineSkinWebpath() {
        if(!defined("_skinwebpath_"))
            define("_skinwebpath_", _webpath_.self::getPathForSkin(class_carrier::getInstance()->getObjSession()->getAdminSkin()));
    }

    /**
     * Makes use of the admin-skin image-mapper to resolve an image-name into a
     * real image-tag / script / whatever
     *
     * @param $strName
     * @param string $strAlt
     * @param bool $bitBlockTooltip
     * @param string $strEntryId
     *
     * @return string
     */
    public static function getAdminImage($strName, $strAlt = "", $bitBlockTooltip = false, $strEntryId = "") {
        if(self::$objAdminImageResolver == null) {

            if(!is_file(_realpath_.self::getPathForSkin(class_carrier::getInstance()->getObjSession()->getAdminSkin())."/class_adminskin_imageresolver.php")) {
                return "<img src=\""._skinwebpath_."/pics/".$strName."\"  alt=\"".$strAlt."\"  ".(!$bitBlockTooltip ? "rel=\"tooltip\" title=\"".$strAlt."\" " : "" )." ".($strEntryId != "" ? " id=\"".$strEntryId."\" " : "" )."  />";
            }
            else
                include_once _realpath_.self::getPathForSkin(class_carrier::getInstance()->getObjSession()->getAdminSkin())."/class_adminskin_imageresolver.php";
            self::$objAdminImageResolver = new class_adminskin_imageresolver();
        }

        return self::$objAdminImageResolver->getImage($strName, $strAlt, $bitBlockTooltip, $strEntryId);
    }
}


{'fraction_non_alphanumeric': 0.21222155328115594, 'fraction_numerical': 0.006321493076459964, 'mean_word_length': 2.2320038910505837, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3862943', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1755, 'n_words': 354}