<commit_before><?php
/*
 * @author Anakeen
 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License
 * @package FDL
*/
/**
 * Detailled search
 *
 * @author Anakeen
 * @version $Id: Method.SpecialSearch.php,v 1.3 2007/08/01 14:07:12 eric Exp $
 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License
 * @package FDL
 * @subpackage GED
 */
/**
 */
/**
 * @begin-method-ignore
 * this part will be deleted when construct document class until end-method-ignore
 */
class _SSEARCH extends DocSearch
{
    /*
     * @end-method-ignore
    */
    
    var $defaultedit = "FDL:EDITBODYCARD";
    var $defaultview = "FDL:VIEWBODYCARD";
    /**
     * return sql query to search wanted document
     */
    function ComputeQuery($keyword = "", $famid = - 1, $latest = "yes", $sensitive = false, $dirid = - 1, $subfolder = true, $full = false)
    {
        
        return true;
    }
    
    function getDocList($start = 0, $slice = "ALL", $qtype = "TABLE", $userid = "")
    {
        $phpfile = $this->getRawValue("se_phpfile");
        $phpfunc = $this->getRawValue("se_phpfunc");
        $phparg = $this->getRawValue("se_phparg");
        if (!include_once ("EXTERNALS/$phpfile")) {
            global $action;
            $action->AddWarningMsg(sprintf(_("php file %s needed for request not found") , "EXTERNALS/$phpfunc"));
            return false;
        }
        if (!$userid) $userid = $this->getSystemUserId();
        $arg = array(
            $start,
            $slice,
            $userid
        );
        if ($phparg != "") {
            $moreargs = explode(",", $phparg);
            foreach ($moreargs as $k => $v) {
                $v = trim($v);
                if ($v) {
                    if (($v[0] == "%") && (substr($v, -1) == "%")) {
                        $aid = substr($v, 1, -1);
                        if ($aid == "THIS") $moreargs[$k] = & $this;
                        else {
                            $val = $this->getRawValue($aid);
                            if (!$val) $val = $this->getPropertyValue($aid);
                            $moreargs[$k] = $val;
                        }
                    }
                }
            }
            $arg = array_merge($arg, $moreargs);
        }
        $res = call_user_func_array($phpfunc, $arg);
        
        return ($res);
    }
    /**
     * return true if the search has parameters
     */
    function isParameterizable()
    {
        return false;
    }
    /**
     * return true if the search need parameters
     */
    function needParameters()
    {
        return false;
    }
    
    function isStaticSql()
    {
        return true;
    }
    /**
     * return document includes in search folder
     * @param bool $controlview if false all document are returned else only visible for current user  document are return
     * @param array $filter to add list sql filter for selected document
     * @param int $famid family identifier to restrict search
     * @return array array of document array
     */
    
    public function getContent($controlview = true, $filter = array() , $famid = "", $unusedType = "TABLE", $unusedTrash = "")
    {
        $uid = 0;
        if ($controlview) $uid = 1;
        return $this->getDocList(0, "ALL", $uid);
    }
    /**
     * return number of item in this searches
     * @return int -1 if errors<commit_msg>correct notice getContent (refs #3410)<commit_after><?php
/*
 * @author Anakeen
 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License
 * @package FDL
*/
/**
 * Detailled search
 *
 * @author Anakeen
 * @version $Id: Method.SpecialSearch.php,v 1.3 2007/08/01 14:07:12 eric Exp $
 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License
 * @package FDL
 * @subpackage GED
 */
/**
 */
/**
 * @begin-method-ignore
 * this part will be deleted when construct document class until end-method-ignore
 */
class _SSEARCH extends DocSearch
{
    /*
     * @end-method-ignore
    */
    
    var $defaultedit = "FDL:EDITBODYCARD";
    var $defaultview = "FDL:VIEWBODYCARD";
    /**
     * return sql query to search wanted document
     */
    function ComputeQuery($keyword = "", $famid = - 1, $latest = "yes", $sensitive = false, $dirid = - 1, $subfolder = true, $full = false)
    {
        
        return true;
    }
    
    function getDocList($start = 0, $slice = "ALL", $qtype = "TABLE", $userid = "")
    {
        $phpfile = $this->getRawValue("se_phpfile");
        $phpfunc = $this->getRawValue("se_phpfunc");
        $phparg = $this->getRawValue("se_phparg");
        if (!include_once ("EXTERNALS/$phpfile")) {
            global $action;
            $action->AddWarningMsg(sprintf(_("php file %s needed for request not found") , "EXTERNALS/$phpfunc"));
            return false;
        }
        if (!$userid) $userid = $this->getSystemUserId();
        $arg = array(
            $start,
            $slice,
            $userid
        );
        if ($phparg != "") {
            $moreargs = explode(",", $phparg);
            foreach ($moreargs as $k => $v) {
                $v = trim($v);
                if ($v) {
                    if (($v[0] == "%") && (substr($v, -1) == "%")) {
                        $aid = substr($v, 1, -1);
                        if ($aid == "THIS") $moreargs[$k] = & $this;
                        else {
                            $val = $this->getRawValue($aid);
                            if (!$val) $val = $this->getPropertyValue($aid);
                            $moreargs[$k] = $val;
                        }
                    }
                }
            }
            $arg = array_merge($arg, $moreargs);
        }
        $res = call_user_func_array($phpfunc, $arg);
        
        return ($res);
    }
    /**
     * return true if the search has parameters
     */
    function isParameterizable()
    {
        return false;
    }
    /**
     * return true if the search need parameters
     */
    function needParameters()
    {
        return false;
    }
    
    function isStaticSql()
    {
        return true;
    }
    /**
     * return document includes in search folder
     * @param bool $controlview if false all document are returned else only visible for current user  document are return
     * @param array $filter to add list sql filter for selected document
     * @param int $famid family identifier to restrict search
     * @return array array of document array
     */
    
    public function getContent($controlview = true, array $filter = array() , $famid = "", $unusedType = "TABLE", $unusedTrash = "")
    {
        $uid = 0;
        if ($controlview) $uid = 1;
        return $this->getDocList(0, "ALL", $uid);
    }
    /**
     * return number of item in this searches
     * @return int -1 if errors
{'fraction_non_alphanumeric': 0.14021660649819495, 'fraction_numerical': 0.009530685920577618, 'mean_word_length': 1.801779935275081, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3290993', 'n_tokens_mistral': 2098, 'n_tokens_neox': 2053, 'n_words': 546}