当前位置: 首页>>代码示例>>PHP>>正文


PHP OOAddon::isActivated方法代码示例

本文整理汇总了PHP中OOAddon::isActivated方法的典型用法代码示例。如果您正苦于以下问题:PHP OOAddon::isActivated方法的具体用法?PHP OOAddon::isActivated怎么用?PHP OOAddon::isActivated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OOAddon的用法示例。


在下文中一共展示了OOAddon::isActivated方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rex_install_addon

/**
 * Addon Funktionen
 * @package redaxo4
 * @version $Id: function_rex_addons.inc.php,v 1.3 2008/02/25 09:51:18 kills Exp $
 */
function rex_install_addon($addons, $addonname, $installDump = true)
{
    global $REX, $I18N;
    $state = true;
    $install_dir = $REX['INCLUDE_PATH'] . '/addons/' . $addonname;
    $install_file = $install_dir . '/install.inc.php';
    $install_sql = $install_dir . '/install.sql';
    $config_file = $install_dir . '/config.inc.php';
    // Prüfen des Addon Ornders auf Schreibrechte,
    // damit das Addon später wieder gelöscht werden kann
    $state = rex_is_writable($install_dir);
    if ($state === true) {
        if (is_readable($install_file)) {
            require $install_file;
            // Wurde das "install" Flag gesetzt, oder eine Fehlermeldung ausgegeben? Wenn ja, Abbruch
            if (!OOAddon::isInstalled($addonname) || !empty($REX['ADDON']['installmsg'][$addonname])) {
                $state = $I18N->msg('addon_no_install', $addonname) . '<br />';
                if ($REX['ADDON']['installmsg'][$addonname] == '') {
                    $state .= $I18N->msg('addon_no_reason');
                } else {
                    $state .= $REX['ADDON']['installmsg'][$addonname];
                }
            } else {
                // check if config file exists
                if (is_readable($config_file)) {
                    if (!OOAddon::isActivated($addonname)) {
                        require $config_file;
                    }
                } else {
                    $state = $I18N->msg('addon_config_not_found');
                }
                if ($installDump === true && $state === true && is_readable($install_sql)) {
                    $state = rex_install_dump($install_sql);
                    if ($state !== true) {
                        $state = 'Error found in install.sql:<br />' . $state;
                    }
                }
                // Installation ok
                if ($state === true) {
                    // regenerate Addons file
                    $state = rex_generateAddons($addons);
                }
            }
        } else {
            $state = $I18N->msg('addon_install_not_found');
        }
    }
    if ($state !== true) {
        $REX['ADDON']['install'][$addonname] = 0;
    }
    return $state;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:57,代码来源:function_rex_addons.inc.php

示例2: rex_install_addon

/**
 * Addon Funktionen 
 * @package redaxo3
 * @version $Id: function_rex_addons.inc.php,v 1.2 2005/12/30 09:34:47 kills Exp $
 */
function rex_install_addon($addons, $addonname)
{
    global $REX, $I18N;
    $state = true;
    $install_dir = $REX['INCLUDE_PATH'] . "/addons/{$addonname}";
    $install_file = $install_dir . "/install.inc.php";
    $config_file = $install_dir . "/config.inc.php";
    // Prüfen des Addon Ornders auf Schreibrechte,
    // damit das Addon später wieder gelöscht werden kann
    $state = rex_is_writable($install_dir);
    if ($state === true) {
        if (is_readable($install_file)) {
            include $install_file;
            // Wurde das "install" Flag gesetzt, oder eine Fehlermeldung ausgegeben? Wenn ja, Abbruch
            if (!OOAddon::isInstalled($addonname) || !empty($REX['ADDON']['installmsg'][$addonname])) {
                $state = $I18N->msg("addon_no_install", $addonname) . "<br/>";
                if ($REX['ADDON']['installmsg'][$addonname] == "") {
                    $state .= $I18N->msg("addon_no_reason");
                } else {
                    $state .= $REX['ADDON']['installmsg'][$addonname];
                }
            } else {
                // check if config file exists
                if (is_readable($config_file)) {
                    // skip config if it is a reinstall !
                    if (!OOAddon::isActivated($addonname)) {
                        // if config is broken installation prozess will be terminated -> no install -> no errors in redaxo
                        include $config_file;
                    }
                } else {
                    $state = $I18N->msg("addon_config_not_found");
                }
                // Installation ok
                if ($state === true) {
                    // regenerate Addons file
                    $state = rex_generateAddons($addons);
                }
            }
        } else {
            $state = $I18N->msg("addon_install_not_found");
        }
    }
    return $state;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:49,代码来源:function_rex_addons.inc.php

示例3: foreach

" />
							</a>
							<a href="#" onclick="deleteREXLink(3);return false;">
								<img src="media/file_del.gif" width="16" height="16" title="<?php 
echo $I18N_KURSE->msg('remove_link');
?>
" alt="<?php 
echo $I18N_KURSE->msg('remove_link');
?>
" />
							</a>
						</p>
					</div>
					
					<?php 
if (OOAddon::isActivated('multinewsletter')) {
    ?>
					<div class="rex-form-row rex-form-element-v1">
						<p class="rex-form-text">
							<label for="multinewsletter_group"><?php 
    echo $I18N_KURSE->msg('multinewsletter_gruppe');
    ?>
</label>
							<?php 
    require_once $REX['INCLUDE_PATH'] . '/addons/multinewsletter/classes/class.multinewsletter_group.inc.php';
    $groups = new rex_select();
    $groups->setSize(1);
    $groups->setAttribute('class', 'myrex_select');
    $groups->addOption($I18N_KURSE->msg('multinewsletter_nicht_anmelden'), '0');
    $newsletter_groups = MultinewsletterGroupList::getAll($REX['TABLE_PREFIX']);
    foreach ($newsletter_groups as $group) {
开发者ID:TobiasKrais,项目名称:d2u_kurse,代码行数:31,代码来源:einstellungen.inc.php

示例4: rex_generateAddons

/**
* Schreibt Addoneigenschaften in die Datei include/addons.inc.php
* @param array Array mit den Namen der Addons aus dem Verzeichnis addons/
*/
function rex_generateAddons($ADDONS, $debug = false)
{
    global $REX;
    natsort($ADDONS);
    $content = "";
    foreach ($ADDONS as $cur) {
        if (!OOAddon::isInstalled($cur)) {
            $REX['ADDON']['install'][$cur] = 0;
        }
        if (!OOAddon::isActivated($cur)) {
            $REX['ADDON']['status'][$cur] = 0;
        }
        $content .= "\$REX['ADDON']['install']['{$cur}'] = " . $REX['ADDON']['install'][$cur] . ";\n" . "\$REX['ADDON']['status']['{$cur}'] = " . $REX['ADDON']['status'][$cur] . ";\n\n";
    }
    // Da dieser Funktion öfter pro request aufgerufen werden kann,
    // hier die caches löschen
    clearstatcache();
    $file = $REX['INCLUDE_PATH'] . "/addons.inc.php";
    if (!rex_replace_dynamic_contents($file, $content)) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return true;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:27,代码来源:function_rex_generate.inc.php

示例5: foreach

 	  </thead>
 	  <tbody>';
   foreach ($ADDONS as $cur) {
       if (OOAddon::isSystemAddon($cur)) {
           $delete = $I18N->msg("addon_systemaddon");
       } else {
           $delete = '<a href="index.php?page=addon&amp;addonname=' . $cur . '&amp;delete=1" onclick="return confirm(\'' . htmlspecialchars($I18N->msg('addon_delete_question', $cur)) . '\');">' . $I18N->msg("addon_delete") . '</a>';
       }
       if (OOAddon::isInstalled($cur)) {
           $install = $I18N->msg("addon_yes") . ' - <a href="index.php?page=addon&amp;addonname=' . $cur . '&amp;install=1">' . $I18N->msg("addon_reinstall") . '</a>';
           $uninstall = '<a href="index.php?page=addon&amp;addonname=' . $cur . '&amp;uninstall=1" onclick="return confirm(\'' . htmlspecialchars($I18N->msg("addon_uninstall_question", $cur)) . '\');">' . $I18N->msg("addon_uninstall") . '</a>';
       } else {
           $install = $I18N->msg("addon_no") . ' - <a href="index.php?page=addon&amp;addonname=' . $cur . '&amp;install=1">' . $I18N->msg("addon_install") . '</a>';
           $uninstall = $I18N->msg("addon_notinstalled");
       }
       if (OOAddon::isActivated($cur)) {
           $status = $I18N->msg("addon_yes") . ' - <a href="index.php?page=addon&amp;addonname=' . $cur . '&amp;activate=0">' . $I18N->msg("addon_deactivate") . '</a>';
       } elseif (OOAddon::isInstalled($cur)) {
           $status = $I18N->msg("addon_no") . ' - <a href="index.php?page=addon&amp;addonname=' . $cur . '&amp;activate=1">' . $I18N->msg("addon_activate") . '</a>';
       } else {
           $status = $I18N->msg("addon_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=addon&amp;spage=help&amp;addonname=' . $cur . '">?</a>]</td>
         <td>' . $install . '</td>
         <td>' . $status . '</td>
         <td>' . $uninstall . '</td>
         <td>' . $delete . '</td>
       </tr>' . "\n   ";
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:addon.inc.php

示例6: rex_install_dump

<?php

$mypage = 'd2u_stellenmarkt';
// Jetzt das SQL dieses Addons installieren
$error = rex_install_dump(dirname(__FILE__) . '/install.sql');
if (!OOAddon::isActivated('xoutputfilter')) {
    // xoutputfilter aktivieren
    $error = "Das Addon XOutputFilter ist für die Installation notwendig";
}
if ($error != 1) {
    $REX['ADDON']['installmsg'][$mypage] = $error;
} else {
    $REX['ADDON']['install'][$mypage] = true;
}
开发者ID:TobiasKrais,项目名称:d2u_stellenmarkt,代码行数:14,代码来源:install.inc.php

示例7: isAvailable

 function isAvailable($addon)
 {
     return OOAddon::isInstalled($addon) && OOAddon::isActivated($addon);
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:4,代码来源:class.ooaddon.inc.php

示例8: i18n

<?php

$mypage = 'd2u_stellenmarkt';
// Sprachobjekt
$I18N_STELLEN = new i18n($REX['LANG'], $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/lang');
$REX['ADDON']['page'][$mypage] = $mypage;
$REX['ADDON']['name'][$mypage] = "Stellenmarkt";
$REX['ADDON']['version'][$mypage] = '2.0.7';
$REX['ADDON']['perm'][$mypage] = $mypage . '[]';
$REX['ADDON']['author'][$mypage] = "www.design-to-use.de - Tobias Krais - http://www.design-to-use.de/";
$REX['PERM'][] = $mypage . '[]';
// SEO42 Erweiterung
if (OOAddon::isActivated('seo42')) {
    // SEO42
    require_once dirname(__FILE__) . "/extensions/seo42.inc.php";
    // URLs fuer SEO42 bekannt machen
    rex_register_extension('SEO42_PATHLIST_CREATED', 'd2u_stellenmarkt_extended_urls');
    // URLs in Sitemap eintragen
    rex_register_extension('SEO42_SITEMAP_ARRAY_CREATED', 'd2u_stellenmarkt_extended_sitemap');
}
rex_register_extension('OOMEDIA_IS_IN_USE', 'rex_d2u_stellenmarkt_media_is_in_use');
// add subpages
$REX['ADDON'][$mypage]['SUBPAGES'] = array(array('', $I18N_STELLEN->msg('stellenangebote')), array('kategorien', $I18N_STELLEN->msg('kategorien')), array('kontakte', $I18N_STELLEN->msg('kontakte')));
if (OOPlugin::isAvailable('d2u_stellenmarkt', 'hr4you_sync')) {
    array_push($REX['ADDON'][$mypage]['SUBPAGES'], array('hr4you_sync', 'HR4YOU Sync'));
}
/**
 * Prüft ob dieses Addon Medien im Medienpool nutzt.
 * @global array $REX Redaxo Einstellungen
 * @param type $params Übergabeparameter des Extension Points
 * @return string Warnnachricht als Array
开发者ID:TobiasKrais,项目名称:d2u_stellenmarkt,代码行数:31,代码来源:config.inc.php

示例9: rex_generateAddons

/**
* Schreibt Addoneigenschaften in die Datei include/addons.inc.php
* @param array Array mit den Namen der Addons aus dem Verzeichnis addons/
*/
function rex_generateAddons($ADDONS, $debug = false)
{
    global $REX;
    natsort($ADDONS);
    $content = "// --- DYN\n\n";
    foreach ($ADDONS as $cur) {
        if (!OOAddon::isInstalled($cur)) {
            $REX['ADDON']['install'][$cur] = 0;
        }
        if (!OOAddon::isActivated($cur)) {
            $REX['ADDON']['status'][$cur] = 0;
        }
        $content .= "\$REX['ADDON']['install']['{$cur}'] = " . $REX['ADDON']['install'][$cur] . ";\n" . "\$REX['ADDON']['status']['{$cur}'] = " . $REX['ADDON']['status'][$cur] . ";\n\n";
    }
    $content .= "// --- /DYN";
    $file = $REX['INCLUDE_PATH'] . "/addons.inc.php";
    // Sichergehen, dass die Datei existiert und beschreibbar ist
    if (is_writable($file)) {
        if (!($h = fopen($file, "r"))) {
            return 'Konnte Datei "' . $file . '" nicht lesen';
        }
        $fcontent = fread($h, filesize($file));
        $fcontent = ereg_replace("(\\/\\/.---.DYN.*\\/\\/.---.\\/DYN)", $content, $fcontent);
        fclose($h);
        if (!($h = fopen($file, "w+"))) {
            return 'Konnte Datei "' . $file . '" nicht zum schreiben oeffnen';
        }
        //if (!fwrite($h, $fcontent, strlen($fcontent))) {
        if (!fwrite($h, $fcontent, strlen($fcontent))) {
            return 'Konnte Inhalt nicht in Datei "' . $file . '" schreiben';
        }
        fclose($h);
        // alles ist gut gegangen
        return true;
    } else {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:42,代码来源:function_rex_generate.inc.php

示例10: dirname

<?php

$parent = 'rexsearch';
$mypage = 'reindex';
$REX['ADDON']['version'][$mypage] = '0.1';
$REX['ADDON']['author'][$mypage] = 'Robert Rupf';
$REX['ADDON']['supportpage'][$mypage] = 'forum.redaxo.de';
$REX['EXTRAPERM'][] = $parent . '[' . $mypage . ']';
include_once dirname(__FILE__) . '/functions/function.reindex.inc.php';
include_once dirname(__FILE__) . '/functions/function.reindex_article.inc.php';
if ($REX['REDAXO'] and is_object($REX['USER']) and ($REX['USER']->hasPerm($parent . '[' . $mypage . ']') or $REX['USER']->isAdmin())) {
    $I18N->appendFile(dirname(__FILE__) . '/lang/');
    if (rex_get('func') == 'reindex' and rex_get('article_id', 'int') and 0 <= rex_get('clang', 'int', -1)) {
        rex_register_extension('ADDONS_INCLUDED', function () {
            global $REX;
            $rexsearch = new RexSearch();
            $rexsearch->indexArticle($REX['ARTICLE_ID'], $REX['CUR_CLANG']);
            rex_register_extension('PAGE_CONTENT_OUTPUT', function ($_params) {
                global $I18N;
                echo rex_info($I18N->msg('a587_reindex_done'));
            });
        });
    }
}
if (OOAddon::isActivated('rexsearch') or class_exists('rexsearch')) {
    rex_register_extension('REX_FORM_SAVED', 'a587_rexsearch_reindex');
    rex_register_extension('REX_XFORM_SAVED', 'a587_rexsearch_reindex');
    rex_register_extension('REX_FORM_DELETED', 'a587_rexsearch_reindex');
    rex_register_extension('PAGE_CONTENT_MENU', 'a587_rexsearch_reindex_article');
}
开发者ID:olien,项目名称:rexsearch,代码行数:30,代码来源:config.inc.php

示例11: confirm

 } else {
     $delete = '<a href="' . $addonurl . 'delete=1" onclick="return confirm(\'' . htmlspecialchars($I18N->msg('addon_delete_question', $addon)) . '\');">' . $I18N->msg('addon_delete') . '</a>';
 }
 if (OOAddon::isInstalled($addon)) {
     $install = $I18N->msg('addon_yes') . ' - <a href="' . $addonurl . 'install=1">' . $I18N->msg('addon_reinstall') . '</a>';
     if (count(OOPlugin::getInstalledPlugins($addon)) > 0) {
         $uninstall = $I18N->msg('plugin_plugins_installed');
         $delete = $I18N->msg('plugin_plugins_installed');
     } else {
         $uninstall = '<a href="' . $addonurl . 'uninstall=1" onclick="return confirm(\'' . htmlspecialchars($I18N->msg('addon_uninstall_question', $addon)) . '\');">' . $I18N->msg('addon_uninstall') . '</a>';
     }
 } else {
     $install = $I18N->msg('addon_no') . ' - <a href="' . $addonurl . 'install=1">' . $I18N->msg('addon_install') . '</a>';
     $uninstall = $I18N->msg('addon_notinstalled');
 }
 if (OOAddon::isActivated($addon)) {
     $status = $I18N->msg('addon_yes') . ' - <a href="' . $addonurl . 'activate=0">' . $I18N->msg('addon_deactivate') . '</a>';
 } elseif (OOAddon::isInstalled($addon)) {
     $status = $I18N->msg('addon_no') . ' - <a href="' . $addonurl . 'activate=1">' . $I18N->msg('addon_activate') . '</a>';
 } else {
     $status = $I18N->msg('addon_notinstalled');
 }
 echo '
         <tr class="rex-addon">
             <td class="rex-icon rex-col-a"><span class="rex-i-element rex-i-addon"><span class="rex-i-element-text">' . htmlspecialchars($addon) . '</span></span></td>
             <td class="rex-col-b">' . htmlspecialchars($addon) . ' [<a href="index.php?page=addon&amp;subpage=help&amp;addonname=' . $addon . '">?</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   ";
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:31,代码来源:addon.inc.php

示例12: rex_generateAddons

/**
 * Schreibt Addoneigenschaften in die Datei include/addons.inc.php
 *
 * @param array Array mit den Namen der Addons aus dem Verzeichnis addons/
 *
 * @return TRUE bei Erfolg, sonst FALSE
 */
function rex_generateAddons($ADDONS)
{
    global $REX;
    natsort($ADDONS);
    $content = '';
    foreach ($ADDONS as $addon) {
        if (!OOAddon::isInstalled($addon)) {
            OOAddon::setProperty($addon, 'install', 0);
        }
        if (!OOAddon::isActivated($addon)) {
            OOAddon::setProperty($addon, 'status', 0);
        }
        foreach (array('install', 'status') as $prop) {
            $content .= sprintf("\$REX['ADDON']['%s']['%s'] = '%d';\n", $prop, $addon, OOAddon::getProperty($addon, $prop));
        }
        $content .= "\n";
    }
    // Da dieser Funktion öfter pro request aufgerufen werden kann,
    // hier die caches löschen
    clearstatcache();
    $file = $REX['INCLUDE_PATH'] . '/addons.inc.php';
    if (rex_replace_dynamic_contents($file, $content) === false) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return true;
}
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:33,代码来源:function_rex_generate.inc.php

示例13: rex_getUrl

     print '<label class="text" for="rechnungsformular-iban">IBAN *</label>';
     print '<input type="text" class="text" name="rechnungsformular[iban]" id="rechnungsformular-iban" maxlength="35" value="" required>';
     print '</p>';
     print '<p class="formtext formlabel-bic" id="xform-formular-bic">';
     print '<label class="text" for="rechnungsformular-bic">BIC *</label>';
     print '<input type="text" class="text" name="rechnungsformular[bic]" id="rechnungsformular-bic" maxlength="11" value="" required>';
     print '</p>';
     if ($REX['ADDON']['d2u_kurse']['settings']['vhsagb_artikel'] > 0) {
         print '<p>&nbsp;</p>';
         print '<p class="formcheckbox formlabel-vhsagb" id="xform-formular-vhsagb">';
         print '<input type="checkbox" class="checkbox" name="rechnungsformular[agb]" id="rechnungsformular-agb" value="ja" required>';
         $agb_article = OOArticle::getArticleById($REX['ADDON']['d2u_kurse']['settings']['vhsagb_artikel'], $REX['CUR_CLANG']);
         print '<label class="checkbox" for="rechnungsformular-agb">Hiermit stimme ich den <a href="' . rex_getUrl($REX['ADDON']['d2u_kurse']['settings']['vhsagb_artikel']) . '" target="blank">' . $agb_article->getName() . '</a> zu. *</label>';
         print '</p>';
     }
     if (OOAddon::isActivated('multinewsletter') && $REX['ADDON']['d2u_kurse']['settings']['multinewsletter_group'] > 0) {
         print '<p class="formcheckbox formlabel-multinewsletter" id="xform-formular-vhsagb">';
         print '<input type="checkbox" class="checkbox" name="rechnungsformular[multinewsletter]" id="rechnungsformular-multinewsletter" value="ja">';
         print '<label class="checkbox" for="rechnungsformular-multinewsletter">Bitte informieren Sie per E-Mail Newsletter über ein neues VHS Programm. Sie erhalten 2 bis 4 Newsletter pro Jahr. Ihre Anmeldung können Sie jederzeit widerrufen.</label>';
         print '</p>';
     }
     print '<br><br>* Pflichtfeld<br><br>';
     print '<p class="formsubmit formsubmit">';
     print '<input type="submit" class="submit" name="rechnungsformular[submit]" id="rechnungsformular-submit" value="Jetzt verbindlich buchen">';
     print '</p>';
     print '</form>';
     print '</div>';
     print '</div>';
 } else {
     // Warenkorb
     print '<div class="col-sm-12 col-md-2 abstand">';
开发者ID:TobiasKrais,项目名称:d2u_kurse,代码行数:31,代码来源:Warenkorb-Ausgabe.php

示例14: rex_read_addons_folder

echo $I18N->msg("credits_author");
?>
</th>
				<th><?php 
echo $I18N->msg("credits_supportpage");
?>
</th>
			</tr>
			</thead>

			<tbody>

		<?php 
$ADDONS = rex_read_addons_folder();
foreach ($ADDONS as $cur) {
    $isActive = OOAddon::isActivated($cur);
    $version = OOAddon::getVersion($cur);
    $author = OOAddon::getAuthor($cur);
    $supportPage = OOAddon::getSupportPage($cur);
    if ($isActive) {
        $cl = 'rex-clr-grn';
    } else {
        $cl = 'rex-clr-red';
    }
    echo '<tr><td><span class="' . $cl . '">' . $cur . '</span> [<a href="index.php?page=addon&amp;spage=help&amp;addonname=' . $cur . '">?</a>]</td><td class="' . $cl . '">';
    if ($version) {
        echo '[' . $version . ']';
    }
    echo '</td><td class="' . $cl . '">';
    if ($author) {
        echo $author;
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:credits.inc.php

示例15:

<?php

// add lang file
$I18N->appendFile($REX['INCLUDE_PATH'] . '/addons/website_manager/lang/');
if (!OOAddon::isActivated('website_manager')) {
    // don't allow uninstall if website manager is not active. otherwise codeline hint msg won't be shown.
    $REX['ADDON']['installmsg']['website_manager'] = $I18N->msg('website_manager_uninstall_activate_first');
    $REX['ADDON']['install']['website_manager'] = 1;
} else {
    if (isset($REX['WEBSITE_MANAGER']) && $REX['WEBSITE_MANAGER']->getWebsiteCount() > 1) {
        // user has to manually delete websites first
        $REX['ADDON']['installmsg']['website_manager'] = $I18N->msg('website_manager_uninstall_delete_generated');
        $REX['ADDON']['install']['website_manager'] = 1;
    } else {
        if (!$REX['WEBSITE_MANAGER_SETTINGS']['allow_uninstall']) {
            // user has manually set this option so we can safly proceed with uninstallation
            $REX['ADDON']['installmsg']['website_manager'] = $I18N->msg('website_manager_uninstall_allow_uninstall');
            $REX['ADDON']['install']['website_manager'] = 1;
        } else {
            if (isset($REX['WEBSITE_MANAGER_DO_UNINSTALL']) && !$REX['WEBSITE_MANAGER_DO_UNINSTALL']) {
                // don't allow uninstall if user still has codeline in master.inc.php
                $REX['ADDON']['installmsg']['website_manager'] = $I18N->msg('website_manager_uninstall_codeline_hint');
                $REX['ADDON']['install']['website_manager'] = 1;
            } else {
                $sql = new rex_sql();
                //$sql->debugsql = true;
                $sql->setQuery('DROP TABLE IF EXISTS `rex_website`');
                rex_website_manager_utils::rrmdir(WEBSITE_MANAGER_DATA_DIR);
                rex_generateAll();
                $REX['ADDON']['install']['website_manager'] = 0;
            }
开发者ID:olien,项目名称:website_manager,代码行数:31,代码来源:uninstall.inc.php


注:本文中的OOAddon::isActivated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。