コード例 #1
0
 /**
  * @access public
  */
 function searchCategoryByName($name)
 {
     $query = 'SELECT id FROM ' . OOMedia::getTableName() . ' WHERE name = "' . addslashes($name) . '"';
     $sql = new sql();
     $result = $sql->get_array($query);
     $media = array();
     foreach ($result as $line) {
         $media[] = OOMediaCategory::getCategoryById($line['id']);
     }
     return $media;
 }
コード例 #2
0
 /**
  * @access public
  */
 function isParent($mediaCat)
 {
     if (is_int($mediaCat)) {
         return $mediaCat == $this->getParentId();
     } elseif (OOMediaCategory::isValid($mediaCat)) {
         return $this->getParentId() == $mediaCat->getId();
     }
     return null;
 }
コード例 #3
0
            $msg .= "<br>";
        }
    } else {
        $msg = $I18N->msg('pool_selectedmedia_error');
    }
}
// *************************************** SUBPAGE: "" -> MEDIEN ANZEIGEN
if (!isset($subpage) or $subpage == '') {
    $cats_sel = new select();
    $cats_sel->set_style("width:150px;");
    $cats_sel->set_size(1);
    $cats_sel->set_name("rex_file_category");
    $cats_sel->add_option($I18N->msg('pool_kats_no'), "0");
    $mediacat_ids = array();
    $rootCat = 0;
    if ($rootCats = OOMediaCategory::getRootCategories()) {
        foreach ($rootCats as $rootCat) {
            add_mediacat_options_wperm($cats_sel, $rootCat, $mediacat_ids);
        }
    }
    $cats_sel->set_selected($rex_file_category);
    echo "<table width=100% cellpadding=5 cellspacing=1 border=0 ><tr><td class=grey><b class=head>" . $I18N->msg('pool_file_list') . "</b></td></tr><tr><td></td></tr></table>";
    echo $cat_out;
    print "<table class=rex border=0 cellpadding=5 cellspacing=1 style='width:100%'>\n";
    print "<tr>\r\n    <th align=left class=icon></th>\r\n    <th align=left width=80><b>" . $I18N->msg('pool_file_thumbnail') . "</b></th>\r\n    <th align=left><b>" . $I18N->msg('pool_file_info') . "/ " . $I18N->msg('pool_file_description') . "</b></th>\r\n    <th align=left width=150><b>" . $I18N->msg('pool_file_functions') . "</b></th>\r\n    </tr>\n";
    if (isset($msg) and $msg != "") {
        print "<tr class=warning><td align=center><img src=pics/warning.gif width=16 height=16></td><td class=warning colspan=3>{$msg}</td></tr>";
        $msg = "";
    }
    //deletefilelist und cat change
    print "<form name=rex_file_list action=index.php method=post ENCTYPE=multipart/form-data>\n";
コード例 #4
0
 }
 $link = 'index.php?page=mediapool' . $arg_url . '&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 {
     $OOCats = $OOCat->getChildren();
     // TODO getParentTree() verwenden
     $paths = explode("|", $OOCat->getPath());
     for ($i = 1; $i < count($paths); $i++) {
         $iid = current($paths);
         if ($iid != "") {
             $icat = OOMediaCategory::getCategoryById($iid);
             $textpath .= '<li> : <a href="' . $link . $iid . '">' . $icat->getName() . '</a></li>';
         }
         next($paths);
     }
     $textpath .= '<li> : <a href="' . $link . $cat_id . '">' . $OOCat->getName() . '</a></li>';
     $catpath = $OOCat->getPath() . "{$cat_id}|";
 }
 echo '<div id="rex-navi-path"><ul><li>' . $I18N->msg('pool_kat_path') . '</li> ' . $textpath . '</ul></div>';
 if ($warning != '') {
     echo rex_warning($warning);
     $warning = '';
 }
 if ($info != '') {
     echo rex_info($info);
     $info = '';
コード例 #5
0
 /**
  * @access public
  */
 function getCategory()
 {
     if ($this->_cat === null) {
         $this->_cat =& OOMediaCategory::getCategoryById($this->getCategoryId());
     }
     return $this->_cat;
 }
コード例 #6
0
/**
 * Generiert eine Liste mit den Kindkategorien einer Kategorie.
 *
 * @param $category_id Id der Kategorie
 *
 * @return TRUE bei Erfolg, sonst FALSE
 */
function rex_generateMediaCategoryList($category_id)
{
    global $REX;
    $query = 'SELECT id, cast( name AS SIGNED ) AS sort FROM ' . OOMediaCategory::_getTableName() . ' WHERE re_id = ' . $category_id . ' ORDER BY sort, name';
    $sql = rex_sql::factory();
    //$sql->debugsql = true;
    $sql->setQuery($query);
    $content = '<?php' . "\n";
    for ($i = 0; $i < $sql->getRows(); $i++) {
        $content .= '$REX[\'MEDIA\'][\'RE_CAT_ID\'][' . $category_id . '][' . $i . '] = \'' . $sql->getValue('id') . '\';' . "\n";
        $sql->next();
    }
    $content .= '?>';
    $list_file = $REX['GENERATED_PATH'] . "/files/{$category_id}.mclist";
    if (rex_file::put($list_file, $content)) {
        return true;
    }
    return false;
}
コード例 #7
0
                    <p class="rex-form-submit">
                      <input type="submit" class="rex-form-submit" value="' . $I18N->msg('pool_file_update') . '" name="btn_update"' . rex_accesskey($I18N->msg('pool_file_update'), $REX['ACKEY']['SAVE']) . ' />
                      <input type="submit" class="rex-form-submit rex-form-submit-2" value="' . $I18N->msg('pool_file_delete') . '" name="btn_delete"' . rex_accesskey($I18N->msg('pool_file_delete'), $REX['ACKEY']['DELETE']) . ' onclick="return confirm(\'' . $I18N->msg('delete') . ' ?\');" />
                    </p>
                  </div>

              	<div class="rex-clearer"></div>
              </div>
            </fieldset>
          </form>
        </div>
        ' . $add_image . '
        </div>';
        } else {
            $catname = $I18N->msg('pool_kats_no');
            $Cat = OOMediaCategory::getCategoryById($rex_file_category);
            if ($Cat) {
                $catname = $Cat->getName();
            }
            if ($REX['USER']->hasPerm('advancedMode[]')) {
                $ftitle .= ' [' . $file_id . ']';
                $catname .= ' [' . $rex_file_category . ']';
            }
            echo '<h2 class="rex-hl2">' . $I18N->msg('pool_file_details') . $opener_link . '</h2>
            <div class="rex-form" id="rex-form-mediapool-detail">
              <div class="rex-form-wrapper">
                <div class="rex-mediapool-detail-data"' . $style_width . '>

                  <div class="rex-form-row">
                    <p class="rex-form-read">
                        <label for="ftitle">Titel</label>
コード例 #8
0
/**
 * Erweitert das Meta-Formular um die neuen Meta-Felder
 *
 * @param string   $prefix       Feldprefix
 * @param string   $params       EP Params
 * @param callback $saveCallback Callback, dass die Daten speichert
 */
function _rex_a62_metainfo_form($prefix, $params, $saveCallback)
{
    // Beim ADD gibts noch kein activeItem
    $activeItem = null;
    if (isset($params['activeItem'])) {
        $activeItem = $params['activeItem'];
    }
    $restrictionsCondition = '';
    if ($prefix == 'art_') {
        if ($params['id'] != '') {
            $s = '';
            $OOArt = OOArticle::getArticleById($params['id'], $params['clang']);
            // Alle Metafelder des Pfades sind erlaubt
            foreach (explode('|', $OOArt->getPath()) as $pathElement) {
                if ($pathElement != '') {
                    $s .= ' OR `p`.`restrictions` LIKE "%|' . $pathElement . '|%"';
                }
            }
            $restrictionsCondition = 'AND (`p`.`restrictions` = ""' . $s . ')';
        }
    } elseif ($prefix == 'cat_') {
        $s = '';
        if ($params['id'] != '') {
            $OOCat = OOCategory::getCategoryById($params['id'], $params['clang']);
            // Alle Metafelder des Pfades sind erlaubt
            foreach (explode('|', $OOCat->getPath()) as $pathElement) {
                if ($pathElement != '') {
                    $s .= ' OR `p`.`restrictions` LIKE "%|' . $pathElement . '|%"';
                }
            }
            // Auch die Kategorie selbst kann Metafelder haben
            $s .= ' OR `p`.`restrictions` LIKE "%|' . $params['id'] . '|%"';
        }
        $restrictionsCondition = 'AND (`p`.`restrictions` = ""' . $s . ')';
    } elseif ($prefix == 'med_') {
        $catId = rex_session('media[rex_file_category]', 'int');
        if ($activeItem) {
            $catId = $activeItem->getValue('category_id');
        }
        if ($catId !== '') {
            $s = '';
            if ($catId != 0) {
                $OOCat = OOMediaCategory::getCategoryById($catId);
                // Alle Metafelder des Pfades sind erlaubt
                foreach (explode('|', $OOCat->getPath()) as $pathElement) {
                    if ($pathElement != '') {
                        $s .= ' OR `p`.`restrictions` LIKE "%|' . $pathElement . '|%"';
                    }
                }
            }
            // Auch die Kategorie selbst kann Metafelder haben
            $s .= ' OR `p`.`restrictions` LIKE "%|' . $catId . '|%"';
            $restrictionsCondition = 'AND (`p`.`restrictions` = ""' . $s . ')';
        }
    }
    $sqlFields = _rex_a62_metainfo_sqlfields($prefix, $restrictionsCondition);
    $params = rex_call_func($saveCallback, array($params, $sqlFields), false);
    return rex_a62_metaFields($sqlFields, $activeItem, 'rex_a62_metainfo_form_item', $params);
}
コード例 #9
0
function rex_medienpool_Mediaform($form_title, $button_title, $rex_file_category, $file_chooser, $close_form)
{
    global $I18N, $REX, $REX_USER, $subpage, $ftitle;
    $s = '';
    $cats_sel = new rex_select();
    $cats_sel->setStyle('class="inp100"');
    $cats_sel->setSize(1);
    $cats_sel->setName('rex_file_category');
    $cats_sel->setId('rex_file_category');
    $cats_sel->addOption($I18N->msg('pool_kats_no'), "0");
    $mediacat_ids = array();
    $rootCat = 0;
    if ($rootCats = OOMediaCategory::getRootCategories()) {
        foreach ($rootCats as $rootCat) {
            rex_medienpool_addMediacatOptionsWPerm($cats_sel, $rootCat, $mediacat_ids);
        }
    }
    $cats_sel->setSelected($rex_file_category);
    if (isset($msg) and $msg != "") {
        $s .= rex_warning($msg);
        $msg = "";
    }
    if (!isset($ftitle)) {
        $ftitle = '';
    }
    $add_file = '';
    if ($file_chooser) {
        $devInfos = '';
        if ($REX_USER->hasPerm('advancedMode[]')) {
            $devInfos = '<span class="rex-notice">
         <span>' . $I18N->msg('pool_max_uploadsize') . ':</span> ' . OOMedia::_getFormattedSize(rex_ini_get('upload_max_filesize')) . '

         <!-- Upload-Temp-Dir: ' . rex_ini_get('upload_tmp_dir') . '
         Uploads: ' . (rex_ini_get('file_uploads') == 1 ? 'On' : 'Off') . '<br />
         Max-Upload-Time: ' . rex_ini_get('max_input_time') . 's   -->

       </span>';
        }
        $add_file = '<p>
                   <label for="file_new">' . $I18N->msg('pool_file_file') . '</label>
                   <input type="file" id="file_new" name="file_new" size="30" />
                   ' . $devInfos . '
                 </p>';
    }
    $add_submit = '';
    if (rex_session('media[opener_input_field]') != '') {
        $add_submit = '<input type="submit" class="rex-sbmt" name="saveandexit" value="' . $I18N->msg('pool_file_upload_get') . '"' . rex_accesskey($I18N->msg('pool_file_upload_get'), $REX['ACKEY']['SAVE']) . ' />';
    }
    $s .= '
  		<div class="rex-mpl-oth">
  		<form action="index.php" method="post" enctype="multipart/form-data">
           <fieldset>
             <legend class="rex-lgnd"><span >' . $form_title . '</span></legend>
               <input type="hidden" name="page" value="medienpool" />
               <input type="hidden" name="media_method" value="add_file" />
               <input type="hidden" name="subpage" value="' . $subpage . '" />
               <p>
                 <label for="ftitle">' . $I18N->msg('pool_file_title') . '</label>
                 <input type="text" size="20" id="ftitle" name="ftitle" value="' . htmlspecialchars(stripslashes($ftitle)) . '" />
               </p>
               <p>
                 <label for="rex_file_category">' . $I18N->msg('pool_file_category') . '</label>
                 ' . $cats_sel->get() . '
               </p>
               ' . $add_file . '
               <p class="rex-sbmt">
                 <input type="submit" name="save" value="' . $button_title . '"' . rex_accesskey($button_title, $REX['ACKEY']['SAVE']) . ' />
                 ' . $add_submit . '
               </p>
           </fieldset>
        ';
    if ($close_form) {
        $s .= '</form></div>' . "\n";
    }
    return $s;
}
コード例 #10
0
 /**
  * @access public
  * @deprecated 20.02.2010
  * Stattdessen getCategoryById() nutzen
  */
 function getCategoryByName($name)
 {
     $query = 'SELECT id FROM ' . OOMediaCategory::_getTableName() . ' WHERE name = "' . $name . '"';
     $sql = new rex_sql();
     //$sql->debugsql = true;
     $result = $sql->getArray($query);
     $media = array();
     if (is_array($result)) {
         foreach ($result as $line) {
             $media[] = OOMediaCategory::getCategoryById($line['id']);
         }
     }
     return $media;
 }
コード例 #11
0
        /**
         * creates and returns the uploadform
         */
        public function createUploadForm()
        {
            global $REX, $I18N, $PERMALL;
            $rex_file_category = '';
            if (!$rex_file_category) {
                $rex_file_category = rex_session('media[rex_file_category]', 'int');
            }
            $output = '';
            $script_page_header = '';
            $uploadPath = "index.php?page=" . $this->myself . "&subpage=upload&upload_folder=" . $this->folder . "&faceless=1";
            if ($this->sync_cat) {
                // include cat sync select
                $cats_sel = new rex_select();
                $cats_sel->setStyle('class="inp100"');
                $cats_sel->setSize(1);
                $cats_sel->setName('rex_file_category');
                $cats_sel->setId('rex_file_category_' . $this->time);
                $cats_sel->addOption($I18N->msg('pool_kats_no'), "0");
                $mediacat_ids = array();
                $rootCat = 0;
                $PERMALL = TRUE;
                if ($rootCats = OOMediaCategory::getRootCategories()) {
                    foreach ($rootCats as $rootCat) {
                        rex_mediapool_addMediacatOptionsWPerm($cats_sel, $rootCat, $mediacat_ids);
                    }
                }
                $cats_sel->setSelected($rex_file_category);
            }
            if ($this->markup) {
                $output .= '
          <div class="rex-form">
            <fieldset class="rex-form-col-1">
              <legend>Multiupload</legend>
              <div class="rex-form-wrapper">' . "\n";
                if ($this->sync_cat) {
                    $output .= '
                <div class="rex-form-row">
                  <p class="rex-form-text">
                    <label for="rex_file_category">' . $I18N->msg('pool_file_category') . '</label>
                    ' . $cats_sel->get() . '
                  </p>
                </div>' . "\n";
                }
                $output .= '
                <div class="rex-form-row">
                <label>Upload:</label>' . "\n";
            }
            $output .= '
            <div id="multiupload' . $this->time . '" class="' . ($this->markup ? 'behave_normal' : 'styleless') . '">    
              <noscript>      
                <p>JavaScript muss aktiviert sein.</p>
              </noscript>         
            </div>';
            if ($this->markup) {
                $output .= '
              </div>';
                if (!$this->clear_uploadlist_automatically) {
                    $output .= '<div class="rex-form-row">
                  <p class="rex-form-text">
                    <label>Aktionen</label>
                    <a href="javascript:void(0)" onclick="clearUploadList();">Abgeschlossene / fehlerhafte aus der Liste entfernen</a>
                  </p>
                </div>' . "\n";
                }
            }
            $script_page_header .= '
            <script>
              
              function rex_multiupload_createUploader' . $this->time . '(){            
                var uploader = new qq.FileUploader({
                  element: document.getElementById("multiupload' . $this->time . '"),
                  action: "' . $uploadPath . '",
                  mediaPoolSelector: "rex_file_category_' . $this->time . '",
                  sizeLimit: 0, // max size   
                  minSizeLimit: 0, // min size';
            $script_page_header .= '
                  onSubmit: function(id,filename) {' . "\n";
            if ($this->clear_uploadlist_automatically) {
                $script_page_header .= '
                   clearUploadList();';
            }
            if ($this->onSubmitCallback) {
                $script_page_header .= '
                   
                   if(typeof ' . $this->onSubmitCallback . ' == "function") { 
                     // user callback function
                     ' . $this->onSubmitCallback . '(filename);
                   }';
            }
            $script_page_header .= '
                  },
                  ';
            $script_page_header .= '
                  onUpload: function(id,fileName, xhr) {' . "\n";
            if ($this->onUploadCallback) {
                $script_page_header .= '
                    
                    if(typeof ' . $this->onUploadCallback . ' == "function") { 
                      // user callback function
                      ' . $this->onUploadCallback . '(fileName, xhr);
                    }';
            }
            $script_page_header .= '
                  
                    
                  },
                  ';
            $script_page_header .= '
                  onProgress: function(id,fileName, loaded, total) {' . "\n";
            if ($this->onProgressCallback) {
                $script_page_header .= '
                    
                    if(typeof ' . $this->onProgressCallback . ' == "function") { 
                      // user callback function
                      ' . $this->onProgressCallback . '(fileName, loaded, total);
                    }';
            }
            $script_page_header .= '
                  
                    
                  },
                  ';
            $script_page_header .= '
                  onComplete: function(id,filename,json) {' . "\n";
            if ($this->clear_file_after_finish) {
                $script_page_header .= '                        
                    window.setTimeout(function(){
                      clearUploadListSuccess();
                    }, 5000);';
            }
            if ($this->onCompleteCallback) {
                $script_page_header .= '
                    
                    if(typeof ' . $this->onCompleteCallback . ' == "function" && json.success) { 
                      // user callback function
                      ' . $this->onCompleteCallback . '(json);
                    }';
            }
            $script_page_header .= '
                  
                    
                  },
                  ';
            $script_page_header .= '
                  onCancel: function(id,filename) {' . "\n";
            if ($this->onCancelCallback) {
                $script_page_header .= '
                    
                    if(typeof ' . $this->onCancelCallback . ' == "function") { 
                      // user callback function
                      ' . $this->onCancelCallback . '(filename);
                    }';
            }
            $script_page_header .= '
                  
                    
                  },
                  ';
            if ($this->upload_simultaneously && is_numeric($this->upload_simultaneously)) {
                $script_page_header .= ' 
                  maxConnections: ' . $this->upload_simultaneously . ',';
            }
            $script_page_header .= '
                  debug: ' . ($this->javascript_debug ? "true" : "false") . '
                });           
              }
              
              jQuery(document).ready(function(){
                rex_multiupload_createUploader' . $this->time . '();
              });
            </script>' . "\n";
            if ($this->markup) {
                if ($this->showFootnote) {
                    $output .= '<div class="rex-form-row edit_panel">
                  <label>Dateien editieren</label>
                    <ul class="qq-upload-list edit_uploads">

                    </ul>
                  </p>
                </div>' . "\n";
                }
            }
            if ($this->markup) {
                if ($this->showFootnote) {
                    $output .= '<div class="rex-form-row">
                  <p class="rex-form-file">
                    <span class="rex-form-notice">
                      Mehrfachauswahl mit STRG(WIN) oder CMD(MAC).<br />
                      Die Dateien werden automatisch in die ausgewählte Kategorie sychronisiert.
                      Ein Wechsel der Medienkategorie greift immer vor Auswahl einer Datei. 
                      Findet ein Upload bereits statt, kann für diese Datei die Kategorie nicht mehr verändert werden.
                    </span>
                  </p>
                </div>' . "\n";
                }
                $output .= '  
                </div>
                </fieldset>
                </div>' . "\n";
            }
            // Register EXTENSION POINT
            $header_func = 'return str_replace("<!-- ###MULTIUPLOAD_EP_REPLACE### -->",\'' . $script_page_header . '\'."<!-- ###MULTIUPLOAD_EP_REPLACE### -->",$params["subject"]);';
            rex_register_extension('OUTPUT_FILTER', create_function('$params', $header_func));
            // TIME FOR OUTPUT
            return $output;
        }
コード例 #12
0
/**
 * Ausgabe des Medienpool Formulars
 */
function rex_mediapool_Mediaform($form_title, $button_title, $rex_file_category, $file_chooser, $close_form)
{
    global $I18N, $REX, $subpage, $ftitle, $warning, $info;
    $s = '';
    $cats_sel = new rex_select();
    $cats_sel->setStyle('class="rex-form-select"');
    $cats_sel->setSize(1);
    $cats_sel->setName('rex_file_category');
    $cats_sel->setId('rex_file_category');
    $cats_sel->addOption($I18N->msg('pool_kats_no'), "0");
    $mediacat_ids = array();
    $rootCat = 0;
    if ($rootCats = OOMediaCategory::getRootCategories()) {
        foreach ($rootCats as $rootCat) {
            rex_mediapool_addMediacatOptionsWPerm($cats_sel, $rootCat, $mediacat_ids);
        }
    }
    $cats_sel->setSelected($rex_file_category);
    if (isset($warning) and $warning != "") {
        $s .= rex_warning($warning);
        $warning = "";
    }
    if (isset($info) and $info != "") {
        $s .= rex_info($info);
        $info = "";
    }
    if (!isset($ftitle)) {
        $ftitle = '';
    }
    $add_file = '';
    if ($file_chooser) {
        $devInfos = '';
        if ($REX['USER']->hasPerm('advancedMode[]')) {
            $devInfos = '<span class="rex-form-notice">
         ' . $I18N->msg('phpini_settings') . ':<br />
         ' . (rex_ini_get('file_uploads') == 0 ? '<span>' . $I18N->msg('pool_upload') . ':</span> <em>' . $I18N->msg('pool_upload_disabled') . '</em><br />' : '') . '
         <span>' . $I18N->msg('pool_max_uploadsize') . ':</span> ' . OOMedia::_getFormattedSize(rex_ini_get('upload_max_filesize')) . '<br />
         <span>' . $I18N->msg('pool_max_uploadtime') . ':</span> ' . rex_ini_get('max_input_time') . 's
       </span>';
        }
        $add_file = '
                <div class="rex-form-row">
                  <p class="rex-form-file">
                    <label for="file_new">' . $I18N->msg('pool_file_file') . '</label>
                    <input class="rex-form-file" type="file" id="file_new" name="file_new" size="30" />
                    ' . $devInfos . '
                  </p>
                </div>';
    }
    $add_submit = '';
    if (rex_session('media[opener_input_field]') != '') {
        $add_submit = '<input type="submit" class="rex-form-submit" name="saveandexit" value="' . $I18N->msg('pool_file_upload_get') . '"' . rex_accesskey($I18N->msg('pool_file_upload_get'), $REX['ACKEY']['SAVE']) . ' />';
    }
    $s .= '
      <div class="rex-form" id="rex-form-mediapool-other">
        <form action="index.php" method="post" enctype="multipart/form-data">
          <fieldset class="rex-form-col-1">
            <legend>' . $form_title . '</legend>
            <div class="rex-form-wrapper">
              <input type="hidden" name="page" value="mediapool" />
              <input type="hidden" name="media_method" value="add_file" />
              <input type="hidden" name="subpage" value="' . $subpage . '" />
              
              <div class="rex-form-row">
                <p class="rex-form-text">
                  <label for="ftitle">' . $I18N->msg('pool_file_title') . '</label>
                  <input class="rex-form-text" type="text" size="20" id="ftitle" name="ftitle" value="' . htmlspecialchars(stripslashes($ftitle)) . '" />
                </p>
              </div>
              
              <div class="rex-form-row">
                <p class="rex-form-select">
                  <label for="rex_file_category">' . $I18N->msg('pool_file_category') . '</label>
                  ' . $cats_sel->get() . '
                </p>
              </div>

              <div class="rex-clearer"></div>';
    // ----- EXTENSION POINT
    $s .= rex_register_extension_point('MEDIA_FORM_ADD', '');
    $s .= $add_file . '
              <div class="rex-form-row">
                <p class="rex-form-submit">
                 <input class="rex-form-submit" type="submit" name="save" value="' . $button_title . '"' . rex_accesskey($button_title, $REX['ACKEY']['SAVE']) . ' />
                 ' . $add_submit . '
                </p>
              </div>

              <div class="rex-clearer"></div>
            </div>
          </fieldset>
        ';
    if ($close_form) {
        $s .= '</form></div>' . "\n";
    }
    return $s;
}
コード例 #13
0
 function addCatOptions()
 {
     if ($this->rootId !== null) {
         if (is_array($this->rootId)) {
             foreach ($this->rootId as $rootId) {
                 if ($rootCat = OOMediaCategory::getCategoryById($rootId)) {
                     $this->addCatOption($rootCat);
                 }
             }
         } else {
             if ($rootCat = OOMediaCategory::getCategoryById($this->rootId)) {
                 $this->addCatOption($rootCat);
             }
         }
     } else {
         if ($rootCats = OOMediaCategory::getRootCategories()) {
             foreach ($rootCats as $rootCat) {
                 $this->addCatOption($rootCat);
             }
         }
     }
 }
コード例 #14
0
 /**
  * @access public
  * @deprecated 20.02.2010
  * Stattdessen getCategoryById() nutzen
  */
 function getCategoryByName($name)
 {
     global $REX;
     $sql = rex_sql::factory();
     $sql->setQuery('SELECT id FROM ' . OOMediaCategory::_getTableName() . 'WHERE name="' . $name . '"');
     if ($sql->getRows() == 1) {
         return OOMediaCategory::getCategoryById($sql->getValue('id'));
     }
     return null;
 }