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


include_once(_systempath_."/interface_sc_installer.php");

/**
 * Installer of the filemanager samplecontent
 *
 * @package modul_filemanager
 */
class class_installer_sc_filemanager implements interface_sc_installer  {

    private $objDB;
    private $strContentLanguage;

    /**
     * Does the hard work: installs the module and registers needed constants
     *
     */
    public function install() {
         $strReturn = "";

        $strReturn .= "Creating upload-folder\n";
            if(!is_dir(_portalpath_."/pics/upload"))
                mkdir(_realpath_."/portal/pics/upload");

            $strReturn .= "Creating new file-repository\n";
            include_once(_systempath_."/class_modul_filemanager_repo.php");
            $objRepo = new class_modul_filemanager_repo();

            if($this->strContentLanguage == "de")
                $objRepo->setStrName("Hochgeladene Bilder");
            else
                $objRepo->setStrName("Picture uploads");

            $objRepo->setStrPath("/portal/pics/upload");
            $objRepo->setStrUploadFilter(".jpg,.gif,.png");
            $objRepo->setStrViewFilter(".jpg,.gif,.png");
            $objRepo->saveObjectToDb();
            $strReturn .= "ID of new repo: ".$objRepo->getSystemid()."\n";
        return $strReturn;
    }
    
    public function setObjDb($objDb) {
        $this->objDB = $objDb;
    }
    
    public function setStrContentlanguage($strContentlanguage) {
        $this->strContentLanguage = $strContentlanguage;
    }

    public function getCorrespondingModule() {
        return "filemanager";
    }
    
}
?><commit_msg>NEW: Samplecontent installer creates a filemanager-repository for files in /portal/downloads too<commit_after><?php
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2008 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*                                                                                                       *
*   class_installer_sc_filemanager.php                                                                  *
*   Interface of the filemanager samplecontent                                                          *
*                                                                                                       *
*-------------------------------------------------------------------------------------------------------*
*   $Id$                          *
********************************************************************************************************/


include_once(_systempath_."/interface_sc_installer.php");

/**
 * Installer of the filemanager samplecontent
 *
 * @package modul_filemanager
 */
class class_installer_sc_filemanager implements interface_sc_installer  {

    private $objDB;
    private $strContentLanguage;

    /**
     * Does the hard work: installs the module and registers needed constants
     *
     */
    public function install() {
		$strReturn = "";

        $strReturn .= "Creating picture upload folder\n";
            if(!is_dir(_portalpath_."/pics/upload"))
                mkdir(_realpath_."/portal/pics/upload");

            $strReturn .= "Creating new picture repository\n";
            include_once(_systempath_."/class_modul_filemanager_repo.php");
            $objRepo = new class_modul_filemanager_repo();

            if($this->strContentLanguage == "de")
                $objRepo->setStrName("Hochgeladene Bilder");
            else
                $objRepo->setStrName("Picture uploads");

            $objRepo->setStrPath("/portal/pics/upload");
            $objRepo->setStrUploadFilter(".jpg,.gif,.png");
            $objRepo->setStrViewFilter(".jpg,.gif,.png");
            $objRepo->saveObjectToDb();
            $strReturn .= "ID of new repo: ".$objRepo->getSystemid()."\n";
            
        $strReturn .= "Creating file upload folder\n";
            if(!is_dir(_portalpath_."/downloads"))
                mkdir(_realpath_."/portal/downloads");

            $strReturn .= "Creating new file repository\n";
            include_once(_systempath_."/class_modul_filemanager_repo.php");
            $objRepo = new class_modul_filemanager_repo();

            if($this->strContentLanguage == "de")
                $objRepo->setStrName("Hochgeladene Dateien");
            else
                $objRepo->setStrName("File uploads");

            $objRepo->setStrPath("/portal/downloads");
            $objRepo->setStrUploadFilter(".zip,.pdf,.txt");
            $objRepo->setStrViewFilter(".zip,.pdf,.txt");
            $objRepo->saveObjectToDb();
            $strReturn .= "ID of new repo: ".$objRepo->getSystemid()."\n";
		return $strReturn;
    }
    
    public function setObjDb($objDb) {
        $this->objDB = $objDb;
    }
    
    public function setStrContentlanguage($strContentlanguage) {
        $this->strContentLanguage = $strContentlanguage;
    }

    public function getCorrespondingModule() {
        return "filemanager";
    }
    
}
?>
{'fraction_non_alphanumeric': 0.2213486543695192, 'fraction_numerical': 0.005442999697611128, 'mean_word_length': 1.3950036205648082, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5623088', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1464, 'n_words': 254}