Пример #1
0
 function _getLangInfoArray()
 {
     global $cfg_cms;
     include_once $cfg_cms['path_base'] . $cfg_cms['path_backend_rel'] . "inc/fnc.clients.php";
     return clients_get_langs($this->_getIdclient(), true);
 }
Пример #2
0
function lang_make_start_lang($idclient, $idlang)
{
    global $db, $cms_db;
    $langs = clients_get_langs($idclient);
    if (!is_array($langs['order'])) {
        return;
    } else {
        $in_op = implode(',', $langs['order']);
    }
    //reset all
    $sql = "UPDATE\n\t\t\t\t" . $cms_db['lang'] . "\n\t\t\tSET\n\t\t\t\tis_start='0',\n\t\t\t\tauthor='" . $auth->auth['uid'] . "',\n\t\t\t\tlastmodified='" . time() . "'\n\t\t\tWHERE\n\t\t\t\tidlang IN ({$in_op})";
    $db->query($sql);
    //make start
    $sql = "UPDATE\n\t\t\t\t" . $cms_db['lang'] . "\n\t\t\tSET\n\t\t\t\tis_start='1',\n\t\t\t\tauthor='" . $auth->auth['uid'] . "',\n\t\t\t\tlastmodified='" . time() . "'\n\t\t\tWHERE\n\t\t\t\tidlang='{$idlang}'";
    $db->query($sql);
}
Пример #3
0
function clients_delete_client($idclient)
{
    global $db, $sess, $cms_db;
    //, $val_ct;
    $langs = clients_get_langs($idclient);
    if (is_array($langs['order'])) {
        foreach ($langs['order'] as $idlang) {
            $err = lang_delete_language($idclient, $idlang);
            if (!empty($err)) {
                return $err;
            }
        }
    }
    //$client_config = $val_ct -> get_by_group('cfg_client', $idclient);
    $valcol = sf_api('MODEL', 'ValueSqlCollection');
    $valcol->setIdclient($idclient);
    $valcol->getByGroup('cfg_client');
    $client_config = $valcol->getAssocKeyArray();
    unset($valcol);
    //delete all client data in teh following tables
    $del_data = array($cms_db['clients'], $cms_db['clients_lang'], $cms_db['values'], $cms_db['backendmenu'], $cms_db['css'], $cms_db['directory'], $cms_db['js'], $cms_db['lay'], $cms_db['mod'], $cms_db['upl'], $cms_db['tpl']);
    foreach ($del_data as $v) {
        $sql = "DELETE FROM\n\t\t\t\t\t" . $v . "\n\t\t\t\tWHERE\n\t\t\t\t\tidclient={$idclient}";
        $db->query($sql);
    }
    /* ADDED RECURSIVE FILEDELETE LATER
    	//check fileperms
    	//
    	$file_perm = fileperms ($client_config['path']);
    	$octalperms = sprintf("%o",$file_perm);
    	if(strlen($octalperms) == 5) $octal_final = substr($octalperms,2);
    	else $octal_final = substr($octalperms,3);
    	$octal_back_nr = substr($octal_final,2);
    	//Warnung, wenn perm f�r public < 6
    	if($octal_back_nr < 6){
    		echo "WARNUNG! Die Dateirechte der CSS- Datei entsprechen momentan 'CHMOD $octal_final'. �nderungen an der Datei lassen sich vermutlich nicht speichern";
    		return;
    	}
    	*/
}
Пример #4
0
function con_copy_content_from_idcatside($idclient, $idcatside_from, $idcatside_to)
{
    //init
    global $db, $cms_db, $cfg_cms;
    $db2 = new DB_cms();
    $db3 = new DB_cms();
    //get necessary values from source idcatside
    $sql = "SELECT * FROM " . $cms_db['cat_side'] . " WHERE idcatside='{$idcatside_from}'";
    $db->query($sql);
    if ($db->next_record()) {
        $idcat_from = $db->f('idcat');
        $idside_from = $db->f('idside');
        $sortindex_from = $db->f('sortindex');
    } else {
        return false;
    }
    //get necessary values from target idcatside
    $sql = "SELECT * FROM " . $cms_db['cat_side'] . " WHERE idcatside='{$idcatside_to}'";
    $db->query($sql);
    if ($db->next_record()) {
        $idcat_to = $db->f('idcat');
        $idside_to = $db->f('idside');
        $sortindex_to = $db->f('sortindex');
    } else {
        return false;
    }
    //get langs
    include_once $cfg_cms['cms_path'] . "inc/fnc.clients.php";
    $arr_langs = clients_get_langs($idclient, true);
    // print_r($arr_langs);
    foreach ($arr_langs['order'] as $current_lang) {
        //copy content
        $table_list = array($cms_db['content'], $cms_db['content_external']);
        foreach ($table_list as $current_content_table) {
            $sql = "SELECT \n\t\t\t\t\t\tC.idcontent, C.idsidelang, C.container, C.number, C.idtype, C.typenumber, C.value, C.online, \n\t\t\t\t\t\t\tC.version, C.author, C.created, C.lastmodified,\n\t\t\t\t\t\t\tSL.idside\n\t\t\t\t\tFROM\n\t\t\t\t\t\t" . $current_content_table . " C\n\t\t\t\t\t\tLEFT JOIN " . $cms_db['side_lang'] . " SL USING(idsidelang)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tSL.idlang='{$current_lang}'\n\t\t\t\t\t\tAND SL.idside='{$idside_from}'";
            $db->query($sql);
            while ($db->next_record()) {
                $sql2 = "SELECT \n\t\t\t\t\t\t\tSL.idsidelang \n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t" . $cms_db['side_lang'] . " SL \n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tSL.idlang='{$current_lang}'\n\t\t\t\t\t\t\tAND SL.idside = '{$idside_to}'";
                $db2->query($sql2);
                if ($db2->next_record()) {
                    $sql3 = "INSERT INTO \n\t\t\t\t\t\t\t" . $current_content_table . " \n\t\t\t\t\t\t\t\t(idsidelang, container, number, idtype, typenumber, value, online, \n\t\t\t\t\t\t\t\t\tversion, author, created, lastmodified)\n\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t('" . $db2->f('idsidelang') . "', \n\t\t\t\t\t\t\t\t\t'" . $db->f('container') . "', '" . $db->f('number') . "', '" . $db->f('idtype') . "', \n\t\t\t\t\t\t\t\t\t'" . $db->f('typenumber') . "', '" . make_string_dump($db->f('value')) . "',\n\t\t\t\t\t\t\t\t\t'" . $db->f('online') . "', '" . $db->f('version') . "', '" . $db->f('author') . "',\n\t\t\t\t\t\t\t\t\t'" . $db->f('created') . "', '" . $db->f('lastmodified') . "')";
                    $db3->query($sql3);
                }
            }
        }
    }
}