Beispiel #1
0
<?php

echo rex_babelfish_utils::getHtmlFromMDFile('LICENSE.md');
Beispiel #2
0
<?php

$page = rex_request('page', 'string');
$subpage = rex_request('subpage', 'string');
$func = rex_request('func', 'string');
// save settings
if ($func == 'update') {
    $settings = (array) rex_post('settings', 'array', array());
    rex_babelfish_utils::replaceSettings($settings);
    rex_babelfish_utils::updateSettingsFile();
}
?>

<div class="rex-addon-output">
	<div class="rex-form">

		<h2 class="rex-hl2"><?php 
echo $I18N->msg('babelfish_settings');
?>
</h2>

		<form action="index.php" method="post">

			<fieldset class="rex-form-col-1">
				<div class="rex-form-wrapper">
					<input type="hidden" name="page" value="<?php 
echo $page;
?>
" />
					<input type="hidden" name="subpage" value="<?php 
echo $subpage;
Beispiel #3
0
<?php

// init addon
$REX['ADDON']['name']['babelfish'] = 'Babelfish';
$REX['ADDON']['page']['babelfish'] = 'babelfish';
$REX['ADDON']['version']['babelfish'] = '1.0.0';
$REX['ADDON']['author']['babelfish'] = 'redaxo.org';
$REX['ADDON']['supportpage']['babelfish'] = 'forum.redaxo.org';
$REX['ADDON']['perm']['babelfish'] = 'babelfish[]';
// permissions
$REX['PERM'][] = 'babelfish[]';
// add lang file
if ($REX['REDAXO']) {
    $I18N->appendFile($REX['INCLUDE_PATH'] . '/addons/babelfish/lang/');
}
// includes
require $REX['INCLUDE_PATH'] . '/addons/babelfish/classes/class.rex_babelfish_utils.inc.php';
// default settings (user settings are saved in data dir!)
$REX['ADDON']['babelfish']['settings'] = array('foo' => 'bar', 'foo2' => true);
// overwrite default settings with user settings
rex_babelfish_utils::includeSettingsFile();
if ($REX['REDAXO']) {
    // add subpages
    $REX['ADDON']['babelfish']['SUBPAGES'] = array(array('', $I18N->msg('babelfish_start')), array('settings', $I18N->msg('babelfish_settings')), array('setup', $I18N->msg('babelfish_setup')), array('help', $I18N->msg('babelfish_help')));
    // add css/js files to page header
    if (rex_request('page') == 'babelfish') {
        rex_register_extension('PAGE_HEADER', 'rex_babelfish_utils::appendToPageHeader');
    }
}
Beispiel #4
0
<?php

echo rex_babelfish_utils::getHtmlFromMDFile('CHANGELOG.md');
Beispiel #5
0
<?php

// delete data addon dir
rex_babelfish_utils::removeDataAddonDir();
$REX['ADDON']['install']['babelfish'] = false;
Beispiel #6
0
<?php

$search = array('(CHANGELOG.md)', '(LICENSE.md)');
$replace = array('(index.php?page=babelfish&subpage=help&chapter=changelog)', '(index.php?page=babelfish&subpage=help&chapter=license)');
echo rex_babelfish_utils::getHtmlFromMDFile('README.md', $search, $replace);