Example #1
0
// load the class & filter plugins
if (OFFSET_PATH != 2) {
    // setup does not need (and might have problems with) plugins
    $masks[] = CLASS_PLUGIN;
    if (OFFSET_PATH) {
        $masks[] = ADMIN_PLUGIN | FEATURE_PLUGIN;
    }
    if (DEBUG_PLUGINS) {
        if (OFFSET_PATH) {
            debugLog('Loading the "class" "feature" and "admin" plugins.');
        } else {
            debugLog('Loading the "class" plugins.');
        }
    }
    foreach ($masks as $mask) {
        foreach (getEnabledPlugins() as $extension => $plugin) {
            $priority = $plugin['priority'];
            if ($priority & $mask) {
                if (DEBUG_PLUGINS) {
                    list($usec, $sec) = explode(" ", microtime());
                    $start = (double) $usec + (double) $sec;
                }
                require_once $plugin['path'];
                $_zp_loaded_plugins[$extension] = $extension;
                if (DEBUG_PLUGINS) {
                    zpFunctions::pluginDebug($extension, $priority, $start);
                }
            }
        }
        require_once dirname(__FILE__) . '/auth_zp.php';
        // loaded after CLASS_PLUGIN and before ADMIN_PLUGIN
Example #2
0
<?php

/**
 * Bulk enable/disable of plugins
 * @package core
 */
// force UTF-8 Ø
define('OFFSET_PATH', 3);
require_once dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))) . "/zp-core/admin-globals.php";
admin_securityChecks(ADMIN_RIGHTS, $return = currentRelativeURL());
XSRFdefender('pluginEnabler');
if (isset($_GET['pluginsRemember'])) {
    setOption('pluginEnabler_currentset', serialize(array_keys(getEnabledPlugins())));
    $report = gettext('Current enabled plugins remembered');
}
if (isset($_GET['pluginsEnable'])) {
    $paths = getPluginFiles('*.php');
    $pluginlist = array_keys($paths);
    switch ($setting = sanitize_numeric($_GET['pluginsEnable'])) {
        case 0:
            $report = gettext('Plugins disabled');
            break;
        case 1:
            $report = gettext('Zenphoto plugins enabled');
            break;
        case 2:
            $report = gettext('Remembered plugins enabled');
            $savedlist = getSerializedArray(getOption('pluginEnabler_currentset'));
            break;
        case 3:
            $report = gettext('All plugins enabled');
Example #3
0
					<!-- end of tab_theme div -->
					<?php 
}
if ($subtab == 'plugin' && zp_loggedin(ADMIN_RIGHTS)) {
    if (isset($_GET['single'])) {
        $showExtension = sanitize($_GET['single']);
        $_GET['show-' . $showExtension] = true;
    } else {
        $showExtension = NULL;
    }
    $_zp_plugin_count = 0;
    $plugins = array();
    if (isset($_GET['single'])) {
        $plugins = array($showExtension);
    } else {
        $list = array_keys(getEnabledPlugins());
        foreach ($list as $extension) {
            $option_interface = NULL;
            $path = getPlugin($extension . '.php');
            $pluginStream = file_get_contents($path);
            $str = isolate('$option_interface', $pluginStream);
            if (false !== $str) {
                $plugins[] = $extension;
            }
        }
        natcasesort($plugins);
    }
    $rangeset = getPageSelector($plugins, PLUGINS_PER_PAGE);
    $plugins = array_slice($plugins, $subpage * PLUGINS_PER_PAGE, PLUGINS_PER_PAGE);
    ?>
					<div id="tab_plugin" class="tabbox">
Example #4
0
//$_zp_script_timer['page'] = microtime();
if (!isset($theme)) {
    $theme = setupTheme();
}
//$_zp_script_timer['theme setup'] = microtime();
$custom = SERVERPATH . '/' . THEMEFOLDER . '/' . internalToFilesystem($theme) . '/functions.php';
if (file_exists($custom)) {
    require_once $custom;
} else {
    $custom = false;
}
if (DEBUG_PLUGINS) {
    debugLog('Loading the "theme" plugins.');
}
$_zp_loaded_plugins = array();
foreach (getEnabledPlugins() as $extension => $loadtype) {
    if ($loadtype & THEME_PLUGIN) {
        if (DEBUG_PLUGINS) {
            list($usec, $sec) = explode(" ", microtime());
            $start = (double) $usec + (double) $sec;
        }
        require_once getPlugin($extension . '.php');
        if (DEBUG_PLUGINS) {
            list($usec, $sec) = explode(" ", microtime());
            $end = (double) $usec + (double) $sec;
            debugLog(sprintf('    ' . $extension . '(' . ($priority & PLUGIN_PRIORITY) . ')=>%.4fs', $end - $start));
        }
        //		$_zp_script_timer['load '.$extension] = microtime();
    }
    $_zp_loaded_plugins[] = $extension;
}
Example #5
0
        ?>
</li>
		<?php 
        if (!zp_has_filter('sendmail')) {
            ?>
			<li style="color:RED"><?php 
            echo gettext('There is no mail handler configured!');
            ?>
</li>
			<?php 
        }
        ?>
		</ul>

		<?php 
        $plugins = array_keys(getEnabledPlugins());
        $filters = array();
        $c = count($plugins);
        ?>
		<h3><a href="javascript:toggle('plugins_hide');toggle('plugins_show');" ><?php 
        printf(ngettext("%u active plugin:", "%u active plugins:", $c), $c);
        ?>
</a></h3>
		<div id="plugins_hide" style="display:none">
			<ul class="plugins">
			<?php 
        if ($c > 0) {
            natcasesort($plugins);
            foreach ($plugins as $extension) {
                $pluginStream = file_get_contents(getPlugin($extension . '.php'));
                $plugin_version = '';
Example #6
0
    printf(gettext('Spam filter: <strong>%s</strong>'), getOption('spam_filter'));
    ?>
</li>
	<li><?php 
    printf(gettext('Captcha generator: <strong>%s</strong>'), getOption('captcha'));
    ?>
</li>
	</ul>

	<h3><?php 
    echo gettext("Active plugins:");
    ?>
</h3>
	<ul class="plugins">
	<?php 
    $plugins = getEnabledPlugins();
    if (count($plugins) > 0) {
        natsort($plugins);
        foreach ($plugins as $extension) {
            $ext = substr($extension, 0, strlen($extension) - 4);
            echo "<li>" . $ext . "</li>";
        }
    } else {
        echo '<li>' . gettext('<em>none</em>') . '</li>';
    }
    ?>
	</ul>
	<?php 
    $filters = $_zp_filters;
    ksort($filters);
    ?>
Example #7
0
 * 			[PAGELINK mylinktext customscriptpage] (Provides text for a link to a "custom" script page)
 * 		</li>
 * 	</ol>
 *
 * <b>Note</b> the <var>spaces<var> after the <var>[<var> and before the <var>]<var> square brackets. They are used in these examples to prevent the code from actually executing. They should not be present in your real code.
 *
 * @author Stephen Billard (sbillard)
 *
 * @package plugins
 * @subpackage development
 */
$plugin_is_filter = 5 | ADMIN_PLUGIN;
$plugin_description = gettext('View available <code>content macros</code>.');
$plugin_author = "Stephen Billard (sbillard)";
if (OFFSET_PATH != 2 && zp_loggedin(ZENPAGE_PAGES_RIGHTS | ZENPAGE_NEWS_RIGHTS | ALBUM_RIGHTS)) {
    foreach (getEnabledPlugins() as $ext => $pn) {
        $loadtype = $pn['priority'];
        if ($loadtype & (FEATURE_PLUGIN | THEME_PLUGIN)) {
            require_once $pn['path'];
        }
    }
    unset($ext);
    unset($pn);
    $macros = getMacros();
    if (!empty($macros)) {
        zp_register_filter('admin_tabs', 'macro_admin_tabs');
    }
}
function macro_admin_tabs($tabs)
{
    if (zp_loggedin(ADMIN_RIGHTS)) {
Example #8
0
}
global $class_optionInterface;
// load the class & filter plugins
if (OFFSET_PATH != 2) {
    // setup does not need (and might have problems with) plugins
    $mask = CLASS_PLUGIN;
    if (OFFSET_PATH) {
        $mask = $mask | ADMIN_PLUGIN;
    }
    if (DEBUG_PLUGINS) {
        if (OFFSET_PATH) {
            debugLog('Loading the "class" and "admin" plugins.');
        } else {
            debugLog('Loading the "class" plugins.');
        }
    }
    foreach (getEnabledPlugins() as $extension => $priority) {
        if ($priority & $mask) {
            if (DEBUG_PLUGINS) {
                list($usec, $sec) = explode(" ", microtime());
                $start = (double) $usec + (double) $sec;
            }
            require_once getPlugin($extension . '.php');
            if (DEBUG_PLUGINS) {
                list($usec, $sec) = explode(" ", microtime());
                $end = (double) $usec + (double) $sec;
                debugLog(sprintf('    ' . $extension . '(' . ($priority & PLUGIN_PRIORITY) . ')=>%.4fs', $end - $start));
            }
        }
    }
}