当前位置: 首页>>代码示例>>PHP>>正文


PHP rex_sql::addGlobalCreateFields方法代码示例

本文整理汇总了PHP中rex_sql::addGlobalCreateFields方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_sql::addGlobalCreateFields方法的具体用法?PHP rex_sql::addGlobalCreateFields怎么用?PHP rex_sql::addGlobalCreateFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rex_sql的用法示例。


在下文中一共展示了rex_sql::addGlobalCreateFields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

         $ga = new rex_sql();
         $ga->setQuery("select * from " . $REX['TABLE_PREFIX'] . "user where login='{$redaxo_user_login}'");
         if ($ga->getRows() > 0) {
             $err_msg .= $I18N->msg('setup_042');
         } else {
             if ($REX['PSWFUNC'] != '') {
                 $redaxo_user_pass = call_user_func($REX['PSWFUNC'], $redaxo_user_pass);
             }
             $user = new rex_sql();
             // $user->debugsql = true;
             $user->setTable($REX['TABLE_PREFIX'] . 'user');
             $user->setValue('name', 'Administrator');
             $user->setValue('login', $redaxo_user_login);
             $user->setValue('psw', $redaxo_user_pass);
             $user->setValue('rights', '#admin[]#dev[]#import[]#stats[]#moveSlice[]#');
             $user->addGlobalCreateFields('setup');
             $user->setValue('status', '1');
             if (!$user->insert()) {
                 $err_msg .= $I18N->msg("setup_043");
             }
         }
     }
 } else {
     $gu = new rex_sql();
     $gu->setQuery("select * from " . $REX['TABLE_PREFIX'] . "user LIMIT 1");
     if ($gu->getRows() == 0) {
         $err_msg .= $I18N->msg('setup_044');
     }
 }
 if ($err_msg == '') {
     $checkmodus = 5;
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:setup.inc.php

示例2: save

 /**
  * @access public
  * @return Returns <code>true</code> on success or <code>false</code> on error
  */
 function save()
 {
     $sql = new rex_sql();
     $sql->setTable($this->_getTableName());
     $sql->setValue('re_id', $this->getParentId());
     $sql->setValue('name', $this->getName());
     $sql->setValue('path', $this->getPath());
     $sql->setValue('hide', $this->isHidden());
     if ($this->getId() !== null) {
         $sql->addGlobalUpdateFields();
         $sql->setWhere('id=' . $this->getId() . ' LIMIT 1');
         return $sql->update();
     } else {
         $sql->addGlobalCreateFields();
         return $sql->insert();
     }
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:21,代码来源:class.oomediacategory.inc.php

示例3: rex_medienpool_saveMedia

/**
 * Holt ein upgeloadetes File und legt es in den Medienpool
 * Dabei wird kontrolliert ob das File schon vorhanden ist und es
 * wird eventuell angepasst, weiterhin werden die Fileinformationen übergeben
 *
 * @param $FILE
 * @param $rex_file_category
 * @param $FILEINFOS
 * @param $userlogin
*/
function rex_medienpool_saveMedia($FILE, $rex_file_category, $FILEINFOS, $userlogin = null)
{
    global $REX, $I18N;
    $rex_file_category = (int) $rex_file_category;
    $gc = new rex_sql();
    $gc->setQuery('SELECT * FROM ' . $REX['TABLE_PREFIX'] . 'file_category WHERE id=' . $rex_file_category);
    if ($gc->getRows() != 1) {
        $rex_file_category = 0;
    }
    $FILENAME = $FILE['name'];
    $FILESIZE = $FILE['size'];
    $FILETYPE = $FILE['type'];
    $NFILENAME = rex_medienpool_filename($FILENAME);
    $message = '';
    // ----- neuer filename
    $dstFile = $REX['MEDIAFOLDER'] . '/' . $NFILENAME;
    // ----- dateiupload
    $upload = true;
    if (!@move_uploaded_file($FILE['tmp_name'], $dstFile) && !@copy($FILE['tmp_name'], $dstFile)) {
        $message .= $I18N->msg("pool_file_movefailed");
        $ok = 0;
        $upload = false;
    }
    if ($upload) {
        chmod($dstFile, $REX['FILEPERM']);
        // get widht height
        $size = @getimagesize($dstFile);
        $FILESQL = new rex_sql();
        $FILESQL->setTable($REX['TABLE_PREFIX'] . 'file');
        $FILESQL->setValue('filetype', $FILETYPE);
        $FILESQL->setValue('title', $FILEINFOS['title']);
        $FILESQL->setValue('filename', $NFILENAME);
        $FILESQL->setValue('originalname', $FILENAME);
        $FILESQL->setValue('filesize', $FILESIZE);
        $FILESQL->setValue('width', $size[0]);
        $FILESQL->setValue('height', $size[1]);
        $FILESQL->setValue('category_id', $rex_file_category);
        // TODO Create + Update zugleich?
        $FILESQL->addGlobalCreateFields($userlogin);
        $FILESQL->addGlobalUpdateFields($userlogin);
        $FILESQL->insert();
        $ok = 1;
        $message .= $I18N->msg("pool_file_added");
    }
    $RETURN['title'] = $FILEINFOS['title'];
    $RETURN['width'] = $size[0];
    $RETURN['height'] = $size[1];
    $RETURN['type'] = $FILETYPE;
    $RETURN['msg'] = $message;
    $RETURN['ok'] = $ok;
    $RETURN['filename'] = $NFILENAME;
    $RETURN['old_filename'] = $FILENAME;
    return $RETURN;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:64,代码来源:function_rex_generate.inc.php

示例4: save

 /**
  * @access public
  * @return Returns <code>true</code> on success or <code>false</code> on error
  */
 function save()
 {
     $sql = new rex_sql();
     $sql->setTable($this->_getTableName());
     $sql->setValue('re_file_id', $this->getParentId());
     $sql->setValue('category_id', $this->getCategoryId());
     $sql->setValue('filetype', $this->getType());
     $sql->setValue('filename', $this->getFileName());
     $sql->setValue('originalname', $this->getOrgFileName());
     $sql->setValue('filesize', $this->getSize());
     $sql->setValue('width', $this->getWidth());
     $sql->setValue('height', $this->getHeight());
     $sql->setValue('title', $this->getTitle());
     if ($this->getId() !== null) {
         $sql->addGlobalUpdateFields();
         $sql->setWhere('file_id=' . $this->getId() . ' LIMIT 1');
         return $sql->update();
     } else {
         $sql->addGlobalCreateFields();
         return $sql->insert();
     }
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:26,代码来源:class.oomedia.inc.php

示例5: array

            $AART->setValue('id', $id);
        }
        $AART->setValue('name', $article_name);
        $AART->setValue('catname', $category_name);
        // TODO Neue noch nicht verwendete Datenbankspalten
        // $AART->setValue('attributes', $category_attributes);
        $AART->setValue('attributes', '');
        $AART->setValue('clang', $key);
        $AART->setValue('re_id', $category_id);
        $AART->setValue('prior', $Position_New_Article);
        $AART->setValue('path', $KATPATH);
        $AART->setValue('startpage', 0);
        $AART->setValue('status', 0);
        $AART->setValue('template_id', $template_id);
        // TODO hier Update + Createfields?
        $AART->addGlobalCreateFields();
        $AART->addGlobalUpdateFields();
        if ($AART->insert()) {
            // ----- PRIOR
            rex_newArtPrio($category_id, $key, 0, $Position_New_Article);
        } else {
            $amessage = $AART->getError();
        }
    }
    rex_generateArticle($id);
    // ----- EXTENSION POINT
    $amessage = rex_register_extension_point('ART_ADDED', $amessage, array('id' => $id, 'status' => 0, 'name' => $article_name, 're_id' => $category_id, 'prior' => $Position_New_Article, 'path' => $KATPATH, 'template_id' => $template_id));
} elseif (!empty($artedit_function) && $article_id != '' && $KATPERM) {
    // --------------------- ARTIKEL EDIT
    $Position_Article = (int) $Position_Article;
    if ($Position_Article == 0) {
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:structure.inc.php

示例6: stripslashes

        $del->setQuery("DELETE FROM " . $REX['TABLE_PREFIX'] . "module WHERE id='{$modul_id}'");
        $del->setQuery("DELETE FROM " . $REX['TABLE_PREFIX'] . "module_action WHERE module_id='{$modul_id}'");
        $message = $I18N->msg("module_deleted");
    }
}
if ($function == 'add' or $function == 'edit') {
    if (isset($save) and $save == 'ja') {
        $modultyp = new rex_sql();
        if ($function == 'add') {
            // $modultyp->setQuery("INSERT INTO ".$REX['TABLE_PREFIX']."modultyp (category_id, name, eingabe, ausgabe) VALUES ('$category_id', '$mname', '$eingabe', '$ausgabe')");
            $IMOD = new rex_sql();
            $IMOD->setTable($REX['TABLE_PREFIX'] . 'module');
            $IMOD->setValue('name', $mname);
            $IMOD->setValue('eingabe', $eingabe);
            $IMOD->setValue('ausgabe', $ausgabe);
            $IMOD->addGlobalCreateFields();
            $message = $IMOD->insert($I18N->msg('module_added'));
        } else {
            $modultyp->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'module where id=' . $modul_id);
            if ($modultyp->getRows() == 1) {
                $old_ausgabe = $modultyp->getValue('ausgabe');
                // $modultyp->setQuery("UPDATE ".$REX['TABLE_PREFIX']."modultyp SET name='$mname', eingabe='$eingabe', ausgabe='$ausgabe' WHERE id='$modul_id'");
                $UMOD = new rex_sql();
                $UMOD->setTable($REX['TABLE_PREFIX'] . 'module');
                $UMOD->setWhere('id=' . $modul_id);
                $UMOD->setValue('name', $mname);
                $UMOD->setValue('eingabe', $eingabe);
                $UMOD->setValue('ausgabe', $ausgabe);
                $UMOD->addGlobalUpdateFields();
                $message = $UMOD->update($I18N->msg('module_updated') . ' | ' . $I18N->msg('articel_updated'));
                $new_ausgabe = stripslashes($ausgabe);
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:module.modules.inc.php

示例7: elseif

    // bei add default selected
    $sel_sprachen->setSelected("0");
} elseif (isset($FUNC_ADD) and $FUNC_ADD != '' and (isset($save) and $save == 1)) {
    $adduser = new rex_sql();
    $adduser->setQuery("SELECT * FROM " . $REX['TABLE_PREFIX'] . "user WHERE login = '{$userlogin}'");
    if ($adduser->getRows() == 0 and $userlogin != '') {
        $adduser = new rex_sql();
        $adduser->setTable($REX['TABLE_PREFIX'] . 'user');
        $adduser->setValue('name', $username);
        if ($REX['PSWFUNC'] != '') {
            $userpsw = call_user_func($REX['PSWFUNC'], $userpsw);
        }
        $adduser->setValue('psw', $userpsw);
        $adduser->setValue('login', $userlogin);
        $adduser->setValue('description', $userdesc);
        $adduser->addGlobalCreateFields();
        if (isset($userstatus) and $userstatus == 1) {
            $adduser->setValue('status', 1);
        } else {
            $adduser->setValue('status', 0);
        }
        $perm = '';
        if (isset($useradmin) and $useradmin == 1) {
            $perm .= '#' . 'admin[]';
        }
        if (isset($allcats) and $allcats == 1) {
            $perm .= '#' . 'csw[0]';
        }
        if (isset($allmcats) and $allmcats == 1) {
            $perm .= '#' . 'media[0]';
        }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:user.inc.php

示例8: foreach

     $presavemode |= $status;
 }
 $postsavemode = 0;
 foreach ($postsavestatus as $status) {
     $postsavemode |= $status;
 }
 $faction->setTable($REX['TABLE_PREFIX'] . 'action');
 $faction->setValue('name', $name);
 $faction->setValue('preview', $previewaction);
 $faction->setValue('presave', $presaveaction);
 $faction->setValue('postsave', $postsaveaction);
 $faction->setValue('previewmode', $previewmode);
 $faction->setValue('presavemode', $presavemode);
 $faction->setValue('postsavemode', $postsavemode);
 if ($function == 'add') {
     $faction->addGlobalCreateFields();
     if ($faction->insert()) {
         $info = $I18N->msg('action_added');
     } else {
         $warning = $faction->getError();
     }
 } else {
     $faction->addGlobalUpdateFields();
     $faction->setWhere('id=' . $action_id);
     if ($faction->update()) {
         $info = $I18N->msg('action_updated');
     } else {
         $warning = $faction->getError();
     }
 }
 if (isset($goon) and $goon != '') {
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:module.action.inc.php

示例9: rex_medienpool_registerFile

function rex_medienpool_registerFile($physical_filename, $org_filename, $filename, $category_id, $title, $filesize, $filetype)
{
    global $REX, $REX_USER;
    $abs_file = $REX['MEDIAFOLDER'] . '/' . $physical_filename;
    if (!file_exists($abs_file)) {
        return false;
    }
    if (empty($filesize)) {
        $filesize = filesize($abs_file);
    }
    if (empty($filetype) && function_exists('mime_content_type')) {
        $filetype = mime_content_type($abs_file);
    }
    @chmod($abs_file, $REX['FILEPERM']);
    $filename = rex_medienpool_filename($filename, false);
    $org_filename = strtolower($org_filename);
    // Ggf Alte Datei umbennen
    rename($abs_file, $REX['MEDIAFOLDER'] . '/' . $filename);
    $abs_file = $REX['MEDIAFOLDER'] . '/' . $filename;
    // get widht height
    $size = @getimagesize($abs_file);
    $FILESQL = new rex_sql();
    // $FILESQL->debugsql=1;
    $FILESQL->setTable($REX['TABLE_PREFIX'] . "file");
    $FILESQL->setValue('filename', $filename);
    $FILESQL->setValue('originalname', $org_filename);
    $FILESQL->setValue('category_id', $category_id);
    $FILESQL->setValue('title', $title);
    $FILESQL->setValue('filesize', $filesize);
    $FILESQL->setValue('filetype', $filetype);
    $FILESQL->setValue('width', $size[0]);
    $FILESQL->setValue('height', $size[1]);
    // TODO Hier Update + Create zugleich?
    $FILESQL->addGlobalUpdateFields();
    $FILESQL->addGlobalCreateFields();
    $FILESQL->insert();
    return $FILESQL->getError() == '';
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:38,代码来源:medienpool.inc.php

示例10: rex_copyArticle

/**
 * Kopieren eines Artikels von einer Kategorie in eine andere
 *
 * @param $id          ArtikelId des zu kopierenden Artikels
 * @param $to_cat_id   KategorieId in die der Artikel kopiert werden soll
 */
function rex_copyArticle($id, $to_cat_id)
{
    global $REX, $REX_USER;
    $id = (int) $id;
    $to_cat_id = (int) $to_cat_id;
    $new_id = '';
    // Artikel in jeder Sprache kopieren
    foreach ($REX['CLANG'] as $clang => $clang_name) {
        // validierung der id & from_cat_id
        $from_sql = new rex_sql();
        $qry = 'select * from ' . $REX['TABLE_PREFIX'] . 'article where clang="' . $clang . '" and id="' . $id . '"';
        $from_sql->setQuery($qry);
        if ($from_sql->getRows() == 1) {
            // validierung der to_cat_id
            $to_sql = new rex_sql();
            $to_sql->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'article where clang="' . $clang . '" and startpage=1 and id="' . $to_cat_id . '"');
            if ($to_sql->getRows() == 1 || $to_cat_id == 0) {
                if ($to_sql->getRows() == 1) {
                    $path = $to_sql->getValue('path') . $to_sql->getValue('id') . '|';
                    $catname = $to_sql->getValue('name');
                } else {
                    // In RootEbene
                    $path = '|';
                    $catname = $from_sql->getValue("name");
                }
                $art_sql = new rex_sql();
                $art_sql->setTable($REX['TABLE_PREFIX'] . 'article');
                if ($new_id == "") {
                    $new_id = $art_sql->setNewId('id');
                }
                $art_sql->setValue('id', $new_id);
                // neuen auto_incrment erzwingen
                $art_sql->setValue('re_id', $to_cat_id);
                $art_sql->setValue('path', $path);
                $art_sql->setValue('catname', $catname);
                $art_sql->setValue('catprior', 0);
                $art_sql->setValue('prior', 99999);
                // Artikel als letzten Artikel in die neue Kat einfügen
                $art_sql->setValue('status', 0);
                // Kopierter Artikel offline setzen
                $art_sql->setValue('startpage', 0);
                $art_sql->addGlobalCreateFields();
                // schon gesetzte Felder nicht wieder überschreiben
                $dont_copy = array('id', 'pid', 're_id', 'catname', 'catprior', 'path', 'prior', 'status', 'createdate', 'createuser', 'startpage');
                foreach (array_diff($from_sql->getFieldnames(), $dont_copy) as $fld_name) {
                    $art_sql->setValue($fld_name, $from_sql->getValue($fld_name));
                }
                $art_sql->setValue("clang", $clang);
                $art_sql->insert();
                // ArticleSlices kopieren
                rex_copyContent($id, $new_id, $clang, $clang);
                // Prios neu berechnen
                rex_newArtPrio($to_cat_id, $clang, 1, 0);
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
    // Generated des Artikels neu erzeugen
    rex_generateArticle($id, false);
    // Generated der Kategorien neu erzeugen, da sich derin befindliche Artikel geändert haben
    rex_generateArticle($to_cat_id, false);
    return $new_id;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:72,代码来源:function_rex_generate.inc.php

示例11: stripslashes

     }
 }
 // Daten wieder in den Rohzustand versetzen, da für serialize()/unserialize()
 // keine Zeichen escaped werden dürfen
 for ($i = 1; $i < count($ctypes) + 1; $i++) {
     $ctypes[$i] = stripslashes($ctypes[$i]);
 }
 $TPL = new rex_sql();
 $TPL->setTable($REX['TABLE_PREFIX'] . "template");
 $TPL->setValue("name", $templatename);
 $TPL->setValue("active", $active);
 $TPL->setValue("content", $content);
 if ($function == "add") {
     $attributes = rex_setAttributes("ctype", $ctypes, "");
     $TPL->setValue("attributes", addslashes($attributes));
     $TPL->addGlobalCreateFields();
     if ($TPL->insert()) {
         $template_id = $TPL->getLastId();
         $message = $I18N->msg("template_added");
     } else {
         $message = $TPL->getError();
     }
 } else {
     $attributes = rex_setAttributes("ctype", $ctypes, $attributes);
     $TPL->setWhere("id='{$template_id}'");
     $TPL->setValue("attributes", addslashes($attributes));
     $TPL->addGlobalUpdateFields();
     $message = $TPL->update($I18N->msg("template_updated"));
 }
 // werte werden direkt wieder ausgegeben
 $templatename = stripslashes($templatename);
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:template.inc.php

示例12: rex_mediapool_saveMedia

/**
 * Holt ein upgeloadetes File und legt es in den Medienpool
 * Dabei wird kontrolliert ob das File schon vorhanden ist und es
 * wird eventuell angepasst, weiterhin werden die Fileinformationen übergeben
 *
 * @param $FILE
 * @param $rex_file_category
 * @param $FILEINFOS
 * @param $userlogin
*/
function rex_mediapool_saveMedia($FILE, $rex_file_category, $FILEINFOS, $userlogin = null, $doSubindexing = TRUE)
{
    global $REX, $I18N;
    $rex_file_category = (int) $rex_file_category;
    $gc = new rex_sql();
    $gc->setQuery('SELECT * FROM ' . $REX['TABLE_PREFIX'] . 'file_category WHERE id=' . $rex_file_category);
    if ($gc->getRows() != 1) {
        $rex_file_category = 0;
    }
    $isFileUpload = isset($FILE['tmp_name']);
    if ($isFileUpload) {
        $doSubindexing = TRUE;
    }
    $FILENAME = $FILE['name'];
    $FILESIZE = $FILE['size'];
    $FILETYPE = $FILE['type'];
    $NFILENAME = rex_mediapool_filename($FILENAME, $doSubindexing);
    $message = '';
    // ----- alter/neuer filename
    $srcFile = $REX['MEDIAFOLDER'] . '/' . $FILENAME;
    $dstFile = $REX['MEDIAFOLDER'] . '/' . $NFILENAME;
    $success = true;
    if ($isFileUpload) {
        if (!@move_uploaded_file($FILE['tmp_name'], $dstFile)) {
            $message .= $I18N->msg("pool_file_movefailed");
            $success = false;
        }
    } else {
        if (!@rename($srcFile, $dstFile)) {
            $message .= $I18N->msg("pool_file_movefailed");
            $success = false;
        }
    }
    if ($success) {
        @chmod($dstFile, $REX['FILEPERM']);
        // get widht height
        $size = @getimagesize($dstFile);
        if ($FILETYPE == '' && isset($size['mime'])) {
            $FILETYPE = $size['mime'];
        }
        $FILESQL = new rex_sql();
        $FILESQL->setTable($REX['TABLE_PREFIX'] . 'file');
        $FILESQL->setValue('filetype', $FILETYPE);
        $FILESQL->setValue('title', $FILEINFOS['title']);
        $FILESQL->setValue('filename', $NFILENAME);
        $FILESQL->setValue('originalname', $FILENAME);
        $FILESQL->setValue('filesize', $FILESIZE);
        if ($size) {
            $FILESQL->setValue('width', $size[0]);
            $FILESQL->setValue('height', $size[1]);
        }
        $FILESQL->setValue('category_id', $rex_file_category);
        $FILESQL->addGlobalCreateFields($userlogin);
        $FILESQL->addGlobalUpdateFields($userlogin);
        $FILESQL->insert();
        $message .= $I18N->msg("pool_file_added");
    }
    $RETURN['title'] = $FILEINFOS['title'];
    $RETURN['type'] = $FILETYPE;
    $RETURN['msg'] = $message;
    // Aus BC gruenden hier mit int 1/0
    $RETURN['ok'] = $success ? 1 : 0;
    $RETURN['filename'] = $NFILENAME;
    $RETURN['old_filename'] = $FILENAME;
    if ($size) {
        $RETURN['width'] = $size[0];
        $RETURN['height'] = $size[1];
    }
    // ----- EXTENSION POINT
    if ($success) {
        rex_register_extension_point('MEDIA_ADDED', '', $RETURN);
    }
    return $RETURN;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:84,代码来源:function_rex_mediapool.inc.php

示例13: elseif

     $gf->setQuery('SELECT * FROM ' . $REX['TABLE_PREFIX'] . 'file WHERE category_id=' . $edit_id);
     $gd = new rex_sql();
     $gd->setQuery('SELECT * FROM ' . $REX['TABLE_PREFIX'] . 'file_category WHERE re_id=' . $edit_id);
     if ($gf->getRows() == 0 && $gd->getRows() == 0) {
         $gf->setQuery('DELETE FROM ' . $REX['TABLE_PREFIX'] . 'file_category WHERE id=' . $edit_id);
         $info = $I18N->msg('pool_kat_deleted');
     } else {
         $warning = $I18N->msg('pool_kat_not_deleted');
     }
 } elseif ($media_method == 'add_file_cat') {
     $db = new rex_sql();
     $db->setTable($REX['TABLE_PREFIX'] . 'file_category');
     $db->setValue('name', rex_request('catname', 'string'));
     $db->setValue('re_id', rex_request('cat_id', 'int'));
     $db->setValue('path', rex_request('catpath', 'string'));
     $db->addGlobalCreateFields();
     $db->addGlobalUpdateFields();
     if ($db->insert()) {
         $info = $I18N->msg('pool_kat_saved', stripslashes(rex_request('catname')));
     } else {
         $warning = $db->getError();
     }
 }
 $link = 'index.php?page=mediapool&amp;subpage=categories&amp;cat_id=';
 $textpath = '<li> : <a href="' . $link . '0">Start</a></li>';
 $cat_id = rex_request('cat_id', 'int');
 if ($cat_id == 0 || !($OOCat = OOMediaCategory::getCategoryById($cat_id))) {
     $OOCats = OOMediaCategory::getRootCategories();
     $cat_id = 0;
     $catpath = "|";
 } else {
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:mediapool.structure.inc.php

示例14: rex_addArticle

/**
 * Erstellt einen neuen Artikel
 * 
 * @param array $data Array mit den Daten des Artikels
 * 
 * @return array Ein Array welches den status sowie eine Fehlermeldung beinhaltet
 */
function rex_addArticle($data)
{
    global $REX, $I18N;
    $success = true;
    $message = '';
    if (!is_array($data)) {
        trigger_error('Expecting $data to be an array!', E_USER_ERROR);
    }
    if (isset($data['prior'])) {
        if ($data['prior'] <= 0) {
            $data['prior'] = 1;
        }
    }
    $message = $I18N->msg('article_added');
    $AART = new rex_sql();
    foreach ($REX['CLANG'] as $key => $val) {
        // ------- Kategorienamen holen
        $category = OOCategory::getCategoryById($data['category_id'], $key);
        $category_name = '';
        if ($category) {
            $category_name = addslashes($category->getName());
        }
        $AART->setTable($REX['TABLE_PREFIX'] . 'article');
        if (!isset($id) or !$id) {
            $id = $AART->setNewId('id');
        } else {
            $AART->setValue('id', $id);
        }
        $AART->setValue('name', $data['name']);
        $AART->setValue('catname', $category_name);
        $AART->setValue('attributes', '');
        $AART->setValue('clang', $key);
        $AART->setValue('re_id', $data['category_id']);
        $AART->setValue('prior', $data['prior']);
        $AART->setValue('path', $data['path']);
        $AART->setValue('startpage', 0);
        $AART->setValue('status', 0);
        $AART->setValue('template_id', $data['template_id']);
        $AART->addGlobalCreateFields();
        $AART->addGlobalUpdateFields();
        if ($AART->insert()) {
            // ----- PRIOR
            rex_newArtPrio($data['category_id'], $key, 0, $data['prior']);
        } else {
            $success = false;
            $message = $AART->getError();
        }
        // ----- EXTENSION POINT
        $message = rex_register_extension_point('ART_ADDED', $message, array('id' => $id, 'clang' => $key, 'status' => 0, 'name' => $data['name'], 're_id' => $data['category_id'], 'prior' => $data['prior'], 'path' => $data['path'], 'template_id' => $data['template_id'], 'data' => $data));
    }
    return array($success, $message);
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:59,代码来源:function_rex_structure.inc.php

示例15: dirname

            $module_insert1 = $sql1->insert();
            if ($module_insert1 != 1) {
                $error .= "Modul " . $title1 . " konnte nicht in der DB angelegt werden. Bitte legen Sie es manuell an.";
            }
            // Module Kursausgabe
            $title2 = 'D2U Kurse - Warenkorb';
            $module_dir = dirname(__FILE__) . "/modules/";
            // Input
            $input2 = file_get_contents($module_dir . "Warenkorb-Eingabe.php");
            // Output
            $output2 = file_get_contents($module_dir . "Warenkorb-Ausgabe.php");
            // In DB speichern
            $sql2 = new rex_sql(1);
            $sql2->setTable('rex_module');
            $sql2->setValue('eingabe', addslashes($input2));
            $sql2->setValue('ausgabe', addslashes($output2));
            $sql2->setValue('attributes', 'd2u_kurse[]');
            $sql2->setValue('name', $title2);
            // Createuser & Createdate hinzufügen
            $sql2->addGlobalCreateFields();
            $module_insert2 = $sql2->insert();
            if ($module_insert2 != 1) {
                $error .= "Modul " . $title2 . " konnte nicht in der DB angelegt werden. Bitte legen Sie es manuell an.";
            }
            if ($error != "") {
                $REX['ADDON']['installmsg']['d2u_kurse'] = $error;
            }
            $REX['ADDON']['install']['d2u_kurse'] = true;
        }
    }
}
开发者ID:TobiasKrais,项目名称:d2u_kurse,代码行数:31,代码来源:install.inc.php


注:本文中的rex_sql::addGlobalCreateFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。