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


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

/**
 * Base class for all systemtasks. Provides a few methods to be used by the concrete tasks.
 *
 * @package modul_system
 */
abstract class class_systemtask_base {
    
    private $strTextbase = "system";

	/**
	 * Instance of class_db
	 *
	 * @var class_db
	 */
    private $objDB;
    
    /**
     * Instance of class_text
     *
     * @var class_texte
     */
    private $objTexte;
    
    /**
     * Instance of class_toolkit
     *
     * @var class_toolkit_admin
     */
    protected $objToolkit;

    /**
     * URL used to trigger a reload, e.g. during long tasks
     * @var string
     */
    private $strReloadParam = "";

    /**
     * Infos regarding the current process
     * @var string
     */
    private $strProgressInformation = "";

    /**
     *
     * @var class_modul_system_common
     */
    private $objSystemCommon;

    public function __construct() {
        $arrModule = array();
        $arrModule["author"]        = "<EMAIL>";
        $arrModule["moduleId"]      = _system_modul_id_;
        
        //load the external objects
        $this->objDB = class_carrier::getInstance()->getObjDB();
        $this->objTexte = class_carrier::getInstance()->getObjText();
        $this->objToolkit = class_carrier::getInstance()->getObjToolkit("admin");
        $this->objSystemCommon = new class_modul_system_common();


    }
    
    /**
     * Delegate requests for strings to the text-subsystem
     *
     * @param string $strTextKey
     * @return string
     */
    protected function getText($strTextKey) {
        return $this->objTexte->getText($strTextKey, $this->strTextbase, "admin");	
    }
    
    /**
     * Method invoking the hook-methods to generate a form.
     *
     */
    public final function generateAdminForm() {
    	$strReturn = "";
    	$strFormContent = $this->getAdminForm();
    	
    	if($strFormContent != "") {
    		$strReturn .= $this->objToolkit->formHeader(getLinkAdminHref("system", "systemTasks", "task=".$this->getStrInternalTaskName()));
    		$strReturn .= $strFormContent;
            $strReturn .= $this->objToolkit->formInputHidden("execute", "true");
    		$strReturn .= $this->objToolkit->formInputSubmit($this->objTexte->getText("systemtask_run", "system", "admin"), "Submit", "onclick=\"submitExecution();return false;\"");
    		$strReturn .= $this->objToolkit->formClose();
    		
    		$strReturn .= $this->objToolkit->divider();
    	}
    	
    	return $strReturn;
    }
    
    /**
     * Sets the current textbase, so a module.
     * If your textfiles are coming along with a module different than module system, pass the name here
     * to enable a proper text-loading.
     * 
     * @param string $strModulename
     */
    protected function setStrTextBase($strModulename) {
        $this->strTextbase = $strModulename;        
    }<commit_msg>Systemtaks no longer add a divider to the form<commit_after><?php
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2009 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*   $Id$                               *
********************************************************************************************************/


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

/**
 * Base class for all systemtasks. Provides a few methods to be used by the concrete tasks.
 *
 * @package modul_system
 */
abstract class class_systemtask_base {
    
    private $strTextbase = "system";

	/**
	 * Instance of class_db
	 *
	 * @var class_db
	 */
    private $objDB;
    
    /**
     * Instance of class_text
     *
     * @var class_texte
     */
    private $objTexte;
    
    /**
     * Instance of class_toolkit
     *
     * @var class_toolkit_admin
     */
    protected $objToolkit;

    /**
     * URL used to trigger a reload, e.g. during long tasks
     * @var string
     */
    private $strReloadParam = "";

    /**
     * Infos regarding the current process
     * @var string
     */
    private $strProgressInformation = "";

    /**
     *
     * @var class_modul_system_common
     */
    private $objSystemCommon;

    public function __construct() {
        $arrModule = array();
        $arrModule["author"]        = "<EMAIL>";
        $arrModule["moduleId"]      = _system_modul_id_;
        
        //load the external objects
        $this->objDB = class_carrier::getInstance()->getObjDB();
        $this->objTexte = class_carrier::getInstance()->getObjText();
        $this->objToolkit = class_carrier::getInstance()->getObjToolkit("admin");
        $this->objSystemCommon = new class_modul_system_common();


    }
    
    /**
     * Delegate requests for strings to the text-subsystem
     *
     * @param string $strTextKey
     * @return string
     */
    protected function getText($strTextKey) {
        return $this->objTexte->getText($strTextKey, $this->strTextbase, "admin");	
    }
    
    /**
     * Method invoking the hook-methods to generate a form.
     *
     */
    public final function generateAdminForm() {
    	$strReturn = "";
    	$strFormContent = $this->getAdminForm();
    	
    	if($strFormContent != "") {
    		$strReturn .= $this->objToolkit->formHeader(getLinkAdminHref("system", "systemTasks", "task=".$this->getStrInternalTaskName()));
    		$strReturn .= $strFormContent;
            $strReturn .= $this->objToolkit->formInputHidden("execute", "true");
    		$strReturn .= $this->objToolkit->formInputSubmit($this->objTexte->getText("systemtask_run", "system", "admin"), "Submit", "onclick=\"submitExecution();return false;\"");
    		$strReturn .= $this->objToolkit->formClose();
    		
    	}
    	
    	return $strReturn;
    }
    
    /**
     * Sets the current textbase, so a module.
     * If your textfiles are coming along with a module different than module system, pass the name here
     * to enable a proper text-loading.
     * 
     * @param string $strModulename
     */
    protected function setStrTextBase($strModulename) {
        $this->strTextbase = $strModulename;        
    }
{'fraction_non_alphanumeric': 0.20233950703244674, 'fraction_numerical': 0.005013229355243003, 'mean_word_length': 2.081081081081081, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6957408', 'n_tokens_mistral': 2014, 'n_tokens_neox': 1930, 'n_words': 424}