/**
  * @access public
  */
 function getFiles()
 {
     if ($this->_files === null) {
         $this->_files = array();
         $qry = 'SELECT file_id FROM ' . OOMedia::_getTableName() . ' WHERE category_id = ' . $this->getId();
         $sql = new rex_sql();
         $sql->setQuery($qry);
         $result = $sql->getArray();
         if (is_array($result)) {
             foreach ($result as $line) {
                 $this->_files[] =& OOMedia::getMediaById($line['file_id']);
             }
         }
     }
     return $this->_files;
 }
                          <input class="rex-form-submit" type="submit" value="' . $I18N->msg('pool_search') . '" />
                        </p>
                      </div>
                    </noscript>';
}
$cat_out .= '     </div>
                </fieldset>
              </form>
            </div>
';
// ----- EXTENSION POINT
$cat_out = rex_register_extension_point('MEDIA_LIST_TOOLBAR', $cat_out, array('subpage' => $subpage, 'category_id' => $rex_file_category));
// *************************************** Subpage: Detail
if ($subpage == 'detail' && rex_post('btn_delete', 'string')) {
    // TODO: getMediaById() deprecated, daher getMediaByFileName() nutzen
    $media = OOMedia::getMediaById($file_id);
    if ($media) {
        $file_name = $media->getFileName();
        if ($PERMALL || $REX['USER']->hasPerm('media[' . $media->getCategoryId() . ']')) {
            $uses = $media->isInUse();
            if ($uses === false) {
                if ($media->delete() !== FALSE) {
                    $info = $I18N->msg('pool_file_deleted');
                } else {
                    $warning = $I18N->msg('pool_file_delete_error_1', $file_name);
                }
                $subpage = "";
            } else {
                $warning = array();
                $warning[] = '<strong>' . $I18N->msg('pool_file_delete_error_1', $file_name) . ' ' . $I18N->msg('pool_file_delete_error_2') . '</strong><br />';
                foreach ($uses as $use) {
 /**
  * @access public
  */
 function getMediaByFileName($name)
 {
     $query = 'SELECT file_id FROM ' . OOMedia::_getTableName() . ' WHERE filename = "' . $name . '"';
     $sql = new rex_sql();
     $result = $sql->getArray($query);
     if (is_array($result)) {
         foreach ($result as $line) {
             return OOMedia::getMediaById($line['file_id']);
         }
     }
     return null;
 }
 /**
  * @access public
  */
 function searchMediaByFileName($name)
 {
     $query = 'SELECT file_id FROM ' . OOMedia::_getTableName() . ' WHERE filename = "' . addslashes($name) . '"';
     $sql = new sql();
     $result = $sql->get_array($query);
     $media = array();
     foreach ($result as $line) {
         $media[] = OOMedia::getMediaById($line['file_id']);
     }
     return $media;
 }