Esempio n. 1
0
<?php

if ($CurrentUser->logged_in() && $CurrentUser->has_priv('root_locator')) {
    $this->register_app('root_locator', 'Locator', 1, 'Provide location based listings for your site', '2.0.0');
    $this->require_version('root_locator', '2.8.31');
    $this->add_create_page('root_locator', 'edit');
    $this->add_setting('root_locator_batch_size', 'Batch Size', 'select', 25, array(array('label' => '10 Locations', 'value' => 10), array('label' => '25 Locations', 'value' => 25), array('label' => '50 Locations', 'value' => 50), array('label' => '100 Locations', 'value' => 100)));
    $this->add_setting('root_locator_google_api_key', 'API key', 'text');
    include __DIR__ . '/lib/vendor/autoload.php';
    spl_autoload_register(function ($class_name) {
        if (strpos($class_name, 'RootLocator') === 0) {
            include PERCH_PATH . '/addons/apps/root_locator/lib/' . $class_name . '.class.php';
            return true;
        }
        return false;
    });
    // Search handler
    PerchSystem::register_admin_search_handler('RootLocator_SearchHandler');
}
Esempio n. 2
0
<?php

if ($CurrentUser->logged_in() && $CurrentUser->has_priv('perch_blog')) {
    $this->register_app('perch_blog', 'Blog', 1, 'A simple blog', '4.6');
    $this->require_version('perch_blog', '2.8');
    $this->add_setting('perch_blog_post_url', 'Blog post page path', 'text', '/blog/post.php?s={postSlug}');
    $this->add_setting('perch_blog_slug_format', 'Slug format', 'text', '%Y-%m-%d-{postTitle}');
    $this->add_setting('perch_blog_akismet_key', 'Akismet API key', 'text', '');
    $this->add_setting('perch_blog_comment_notify', 'Notify author of new comments', 'checkbox', '0');
    $this->add_setting('perch_blog_max_spam_days', 'Delete spam comments', 'select', '0', array(array('label' => 'Never', 'value' => '0'), array('label' => 'After 1 day', 'value' => '1'), array('label' => 'After 7 days', 'value' => '7'), array('label' => 'After 14 days', 'value' => '14'), array('label' => 'After 30 days', 'value' => '30'), array('label' => 'After 60 days', 'value' => '60'), array('label' => 'After 90 days', 'value' => '90')));
    $this->add_create_page('perch_blog', 'edit');
    PerchSystem::register_admin_search_handler('PerchBlog_SearchHandler');
    spl_autoload_register(function ($class_name) {
        if (strpos($class_name, 'PerchBlog') === 0) {
            include PERCH_PATH . '/addons/apps/perch_blog/' . $class_name . '.class.php';
            return true;
        }
        return false;
    });
}
Esempio n. 3
0
<?php

$this->register_app('content', 'Pages', 1, 'Default app for managing content', $this->version);
$this->add_setting('content_collapseList', 'Collapse content list', 'checkbox', false);
$this->add_setting('content_singlePageEdit', 'Default to single-page edit mode', 'checkbox', false);
$this->add_setting('content_hideNonEditableRegions', 'Hide regions you can\'t edit', 'checkbox', false);
$this->add_setting('content_frontend_edit', 'Enable Ctrl-E to edit', 'checkbox', false);
PerchSystem::register_admin_search_handler('PerchContent_SearchHandler');
if (PERCH_RUNWAY) {
    PerchSystem::register_admin_search_handler('PerchContent_RunwaySearch');
}
spl_autoload_register(function ($class_name) {
    if (strpos($class_name, 'PerchContent_Runway') === 0) {
        include PERCH_CORE . '/runway/apps/content/' . $class_name . '.class.php';
        return true;
    }
    if (strpos($class_name, 'PerchContent') === 0) {
        include PERCH_CORE . '/apps/content/' . $class_name . '.class.php';
        return true;
    }
    return false;
});