示例#1
0
文件: field.php 项目: alsahh/redaxo
$title = '';
$content = '';
//------------------------------> Parameter
if (empty($prefix)) {
    throw new rex_exception('Fehler: Prefix nicht definiert!');
}
if (empty($metaTable)) {
    throw new rex_exception('Fehler: metaTable nicht definiert!');
}
$Basedir = __DIR__;
$field_id = rex_request('field_id', 'int');
//------------------------------> Feld loeschen
if ($func == 'delete') {
    $field_id = rex_request('field_id', 'int', 0);
    if ($field_id != 0) {
        if (rex_metainfo_delete_field($field_id)) {
            echo rex_view::success(rex_i18n::msg('minfo_field_successfull_deleted'));
        } else {
            echo rex_view::error(rex_i18n::msg('minfo_field_error_deleted'));
        }
    }
    $func = '';
}
//------------------------------> Eintragsliste
if ($func == '') {
    $title = rex_i18n::msg('minfo_field_list_caption');
    // replace LIKE wildcards
    $likePrefix = str_replace(['_', '%'], ['\\_', '\\%'], $prefix);
    $list = rex_list::factory('SELECT id, name FROM ' . rex::getTablePrefix() . 'metainfo_field WHERE `name` LIKE "' . $likePrefix . '%" ORDER BY priority');
    $list->addTableAttribute('class', 'table-striped');
    $tdIcon = '<i class="rex-icon rex-icon-metainfo"></i>';
示例#2
0
<?php

$somethingIsWrong = false;
if ($somethingIsWrong) {
    throw new rex_functional_exception('Something is wrong');
}
if ($somethingIsWrong) {
    $this->setProperty('installmsg', 'Something is wrong');
    $this->setProperty('install', true);
}
rex_metainfo_delete_field('med_focuspoint_data');
rex_metainfo_delete_field('med_focuspoint_css');
$REX['ADDON']['install']['focuspoint'] = 0;