예제 #1
0
   if (!$isActive) {
       $author = $I18N->msg('credits_addon_inactive');
   }
   if ($supportPage) {
       $supportPage = '<a href="http://' . $supportPage . '" onclick="window.open(this.href); return false;">' . $supportPage . '</a>';
   }
   echo '
   	<tr class="rex-addon">
   	  <td class="rex-col-a"><span class="' . $cl . '">' . htmlspecialchars($addon) . '</span> [<a href="index.php?page=addon&amp;subpage=help&amp;addonname=' . $addon . '">?</a>]</td>
   	  <td class="rex-col-b ' . $cl . '">' . $version . '</td>
   	  <td class="rex-col-c' . $cl . '">' . $author . '</td>
   	  <td class="rex-col-d' . $cl . '">' . $supportPage . '</td>
 	  </tr>';
   if ($isActive) {
       foreach (OOPlugin::getAvailablePlugins($addon) as $plugin) {
           $isActive = OOPlugin::isActivated($addon, $plugin);
           $version = OOPlugin::getVersion($addon, $plugin);
           $author = OOPlugin::getAuthor($addon, $plugin);
           $supportPage = OOPlugin::getSupportPage($addon, $plugin);
           if ($isActive) {
               $cl = 'rex-clr-grn';
           } else {
               $cl = 'rex-clr-red';
           }
           if ($version) {
               $version = '[' . $version . ']';
           }
           if ($author) {
               $author = htmlspecialchars($author);
           }
           if (!$isActive) {
/**
 * Schreibt Plugineigenschaften in die Datei include/plugins.inc.php
 *
 * @param array Array mit den Namen der Plugins aus dem Verzeichnis addons/plugins
 *
 * @return TRUE bei Erfolg, sonst eine Fehlermeldung
 */
function rex_generatePlugins($PLUGINS)
{
    global $REX;
    $content = '';
    foreach ($PLUGINS as $addon => $_plugins) {
        foreach ($_plugins as $plugin) {
            if (!OOPlugin::isInstalled($addon, $plugin)) {
                OOPlugin::setProperty($addon, $plugin, 'install', 0);
            }
            if (!OOPlugin::isActivated($addon, $plugin)) {
                OOPlugin::setProperty($addon, $plugin, 'status', 0);
            }
            foreach (array('install', 'status') as $prop) {
                $content .= sprintf("\$REX['ADDON']['plugins']['%s']['%s']['%s'] = '%d';\n", $addon, $prop, $plugin, OOPlugin::getProperty($addon, $plugin, $prop));
            }
            $content .= "\n";
        }
    }
    // Da dieser Funktion öfter pro request aufgerufen werden kann,
    // hier die caches löschen
    clearstatcache();
    $file = $REX['INCLUDE_PATH'] . '/plugins.inc.php';
    if (rex_replace_dynamic_contents($file, $content) === false) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return true;
}
예제 #3
0
             <td class="rex-col-d">' . $status . '</td>
             <td class="rex-col-e">' . $uninstall . '</td>
             <td class="rex-col-f">' . $delete . '</td>
         </tr>' . "\n   ";
 if (OOAddon::isAvailable($addon)) {
     foreach ($PLUGINS[$addon] as $plugin) {
         $pluginurl = 'index.php?page=addon&amp;addonname=' . $addon . '&amp;pluginname=' . $plugin . '&amp;';
         $delete = '<a href="' . $pluginurl . 'delete=1" onclick="return confirm(\'' . htmlspecialchars($I18N->msg('plugin_delete_question', $plugin)) . '\');">' . $I18N->msg('addon_delete') . '</a>';
         if (OOPlugin::isInstalled($addon, $plugin)) {
             $install = $I18N->msg('addon_yes') . ' - <a href="' . $pluginurl . 'install=1">' . $I18N->msg('addon_reinstall') . '</a>';
             $uninstall = '<a href="' . $pluginurl . 'uninstall=1" onclick="return confirm(\'' . htmlspecialchars($I18N->msg('plugin_uninstall_question', $plugin)) . '\');">' . $I18N->msg('addon_uninstall') . '</a>';
         } else {
             $install = $I18N->msg('addon_no') . ' - <a href="' . $pluginurl . 'install=1">' . $I18N->msg('addon_install') . '</a>';
             $uninstall = $I18N->msg('addon_notinstalled');
         }
         if (OOPlugin::isActivated($addon, $plugin)) {
             $status = $I18N->msg('addon_yes') . ' - <a href="' . $pluginurl . 'activate=0">' . $I18N->msg('addon_deactivate') . '</a>';
         } elseif (OOPlugin::isInstalled($addon, $plugin)) {
             $status = $I18N->msg('addon_no') . ' - <a href="' . $pluginurl . 'activate=1">' . $I18N->msg('addon_activate') . '</a>';
         } else {
             $status = $I18N->msg('addon_notinstalled');
         }
         echo '
                 <tr class="rex-plugin">
                     <td class="rex-icon rex-col-a"><span class="rex-i-element rex-i-plugin"><span class="rex-i-element-text">' . htmlspecialchars($plugin) . '</span></span></td>
                     <td class="rex-col-b">' . htmlspecialchars($plugin) . ' [<a href="index.php?page=addon&amp;subpage=help&amp;addonname=' . $addon . '&amp;pluginname=' . $plugin . '">?</a>]</td>
                     <td class="rex-col-c">' . $install . '</td>
                     <td class="rex-col-d">' . $status . '</td>
                     <td class="rex-col-e">' . $uninstall . '</td>
                     <td class="rex-col-f">' . $delete . '</td>
                 </tr>' . "\n   ";
       <th>' . $I18N_COM->msg("plugin_hname") . '</th>
       <th>' . $I18N_COM->msg("plugin_hinstall") . '</th>
       <th>' . $I18N_COM->msg("plugin_hactive") . '</th>
       <th>' . $I18N_COM->msg("plugin_hdelete") . '</th>
     </tr>
   </thead>
   <tbody>';
 foreach ($plugins as $cur) {
     if (OOPlugin::isInstalled($cur)) {
         $install = $I18N_COM->msg("plugin_yes") . ' - <a href="index.php?page=community&subpage=plugin_manager&amp;pluginname=' . $cur . '&amp;install=1">' . $I18N_COM->msg("plugin_reinstall") . '</a>';
         $uninstall = '<a href="index.php?page=community&subpage=plugin_manager&amp;pluginname=' . $cur . '&amp;uninstall=1" onclick="return confirm(\'' . htmlspecialchars($I18N_COM->msg("plugin_uninstall_question", $cur)) . '\');">' . $I18N_COM->msg("plugin_uninstall") . '</a>';
     } else {
         $install = $I18N_COM->msg("plugin_no") . ' - <a href="index.php?page=community&subpage=plugin_manager&amp;pluginname=' . $cur . '&amp;install=1">' . $I18N_COM->msg("plugin_install") . '</a>';
         $uninstall = $I18N_COM->msg("plugin_notinstalled");
     }
     if (OOPlugin::isActivated($cur)) {
         $status = $I18N_COM->msg("plugin_yes") . ' - <a href="index.php?page=community&subpage=plugin_manager&amp;pluginname=' . $cur . '&amp;activate=0">' . $I18N_COM->msg("plugin_deactivate") . '</a>';
     } elseif (OOPlugin::isInstalled($cur)) {
         $status = $I18N_COM->msg("plugin_no") . ' - <a href="index.php?page=community&subpage=plugin_manager&amp;pluginname=' . $cur . '&amp;activate=1">' . $I18N_COM->msg("plugin_activate") . '</a>';
     } else {
         $status = $I18N_COM->msg("plugin_notinstalled");
     }
     echo '
     <tr>
       <td class="rex-icon"><img src="media/addon.gif" alt="' . htmlspecialchars($cur) . '" title="' . htmlspecialchars($cur) . '"/></td>
       <td>' . htmlspecialchars($cur) . ' [<a href="index.php?page=community&subpage=plugin_manager&amp;function=help&amp;pluginname=' . $cur . '">?</a>]</td>
       <td>' . $install . '</td>
       <td>' . $status . '</td>
       <td>' . $uninstall . '</td>
     </tr>' . "\n   ";
 }
function rex_generatePlugins($plugins)
{
    global $REX;
    natsort($plugins);
    $content = "";
    foreach ($plugins as $cur) {
        if (!OOPlugin::isInstalled($cur)) {
            OOPlugin::setProperty($cur, 'install', 0);
        }
        if (!OOPlugin::isActivated($cur)) {
            OOPlugin::setProperty($cur, 'status', 0);
        }
        $content .= sprintf("%s = %d;\n%s = %d;\n\n", OOPlugin::getAsPropertyString($cur, 'install'), OOPlugin::getProperty($cur, 'install'), OOPlugin::getAsPropertyString($cur, 'status'), OOPlugin::getProperty($cur, 'status'));
    }
    $content .= sprintf("\$REX['ADDON']['pluginlist']['community'] = \"%s\";", implode(',', OOPlugin::getRegisteredPlugins()));
    // Da dieser Funktion öfter pro request aufgerufen werden kann,
    // hier die caches löschen
    clearstatcache();
    $file = rex_plugins_file();
    if (!rex_replace_dynamic_contents($file, $content)) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return true;
}
예제 #6
0
<?php

if ($REX['REDAXO']) {
    // add lang file
    $I18N->appendFile($REX['INCLUDE_PATH'] . '/addons/be_utilities/plugins/frontend_link/lang/');
    // default settings (user settings are saved in data dir!)
    $REX['ADDON']['frontend_link']['settings'] = array('metamenu_link' => 'default', 'metamenu_link_text' => '', 'metamenu_header_link' => true);
    // overwrite default settings with user settings
    rex_backend_utilities::includeSettingsFile('frontend_link');
    /// register plugin
    rex_plugin_factory::registerPlugin('be_utilities', 'frontend_link', 'Frontend Link', $I18N->msg('frontend_link_description'), '1.0.0', 'RexDude', 'forum.redaxo.de', true);
    // includes
    include $REX['INCLUDE_PATH'] . '/addons/be_utilities/plugins/frontend_link/classes/class.rex_frontend_link.inc.php';
    // add link to backend
    $thisRexVersion = $REX['VERSION'] . '.' . $REX['SUBVERSION'] . '.' . $REX['MINORVERSION'];
    if ($REX['ADDON']['frontend_link']['settings']['metamenu_link'] != 'none') {
        if (version_compare($thisRexVersion, '4.5.0', '<')) {
            rex_register_extension('OUTPUT_FILTER', 'rex_frontend_link::addFrontendLinkByOutputFilterEP');
        } else {
            rex_register_extension('META_NAVI', 'rex_frontend_link::addFrontendLinkByMetaNaviEP');
        }
    }
    if ($REX['ADDON']['frontend_link']['settings']['metamenu_header_link'] && OOPlugin::isActivated('be_utilities', 'frontend_link')) {
        // link in header
        if (rex_request('page') != 'mediapool' && rex_request('page') != 'linkmap') {
            rex_register_extension('OUTPUT_FILTER', 'rex_frontend_link::addToOutputFilter');
        }
        // link in metamenu
        rex_register_extension('PAGE_HEADER', 'rex_frontend_link::addToPageHeader');
    }
}
예제 #7
0
<?php

/**
 * Kursverwaltung Addon
 * @author www.design-to-use.de - Tobias Krais
 * @author <a href="http://www.design-to-use.de">www.design-to-use.de</a>
 */
$error = "";
if (!OOAddon::isActivated('xform')) {
    $REX['ADDON']['installmsg']['d2u_kurse'] = "XForm Addon wird benötigt, ist aber nicht aktiviert.";
    $REX['ADDON']['install']['d2u_kurse'] = false;
} else {
    if (!OOPlugin::isActivated('xform', 'email')) {
        $REX['ADDON']['installmsg']['d2u_kurse'] = "XForm Email Plugin wird benötigt, ist aber nicht aktiviert.";
        $REX['ADDON']['install']['d2u_kurse'] = false;
    } else {
        if (!OOAddon::isActivated('seo42')) {
            $REX['ADDON']['installmsg']['d2u_kurse'] = "SEO42 Addon wird benötigt, ist aber nicht aktiviert.";
            $REX['ADDON']['install']['d2u_kurse'] = false;
        } else {
            // Module Kursausgabe
            $title1 = 'D2U Kurse - Kursausgabe';
            $module_dir = dirname(__FILE__) . "/modules/";
            // Input
            $input1 = file_get_contents($module_dir . "Kurse-Eingabe.php");
            // Output
            $output1 = file_get_contents($module_dir . "Kurse-Ausgabe.php");
            // In DB speichern
            $sql1 = new rex_sql(1);
            $sql1->setTable('rex_module');
            $sql1->setValue('eingabe', addslashes($input1));