public function __construct()
 {
     new Setting("who_can_create_blogs", "dropdown", array("everyone" => "Everyone", "admin_only" => "Admin Only"), "general", "everyone");
     new MenuItem(array("name" => "blogs", "label" => "Blogs", "page" => "blogs", "list_class" => "visible-xs hidden-sm visible-md visible-lg"));
     new MenuItem(array("name" => "blogs2", "label" => "Blogs", "page" => "blogs", "menu" => "tools"));
     new StorageType("blog", "title", "text");
     new StorageType("blog", "description", "longtext");
     if (pageArray(0) == "blogs" && (pageArray(1) == "add" || pageArray(1) == "edit") || pageArray(0) == 'home' && pageArray(1) == false) {
         new ViewExtension("tinymce/buttons", "blogs/tinymce");
     } else {
         ViewExtension::remove("tinymce/buttons", "blogs/tinymce");
     }
     if (isEnabledPlugin("groups")) {
         new ViewExtension("groups/right", "blogs/group_blogs");
     } else {
         removeViewExtension("groups/right", "blogs/group_blogs");
     }
 }
Пример #2
0
 static function display($path, $variables = array())
 {
     if (!isset($variables['value'])) {
         $variables['value'] = NULL;
     }
     if (!isset($variables['container'])) {
         $variables['container'] = true;
     }
     $return = NULL;
     if (Setting::get("wrap_views") == "yes") {
         $return = "<!-- {$path} -->";
     }
     $view_exists = false;
     $plugin_view = false;
     foreach ($variables as $name => $value) {
         new Vars($name, $value);
     }
     $plugins = Plugin::getEnabledPlugins(true);
     $static_vars = Cache::get("vars", "session");
     $return = runHook("view:before", array("view" => $path, "return" => $return));
     new Cache("vars", $static_vars, "session");
     $return .= ViewExtension::display($path, "before");
     if ($plugins) {
         foreach ($plugins as $plugin) {
             if (is_a($plugin, "SocialApparatus\\Plugin")) {
                 $name = $plugin->name;
                 if (!$plugin_view) {
                     if (file_exists(SITEPATH . "plugins/{$name}/views/{$path}.php")) {
                         $return .= self::getRenderedHTML(SITEPATH . "plugins/{$name}/views/{$path}.php");
                         $plugin_view = true;
                         $view_exists = true;
                     } elseif (file_exists(SITEPATH . "core_plugins/{$name}/views/{$path}.php")) {
                         $return .= self::getRenderedHTML(SITEPATH . "core_plugins/{$name}/views/{$path}.php");
                         $plugin_view = true;
                         $view_exists = true;
                     }
                 }
             }
         }
     }
     if (!$plugin_view) {
         $file_path = SITEPATH . "views/" . $path . ".php";
         if (file_exists($file_path)) {
             $view_exists = true;
             $return .= self::getRenderedHTML($file_path);
         }
     }
     new Cache("vars", $static_vars, "session");
     $return .= viewExtension::display($path, "after");
     return $return;
 }
Пример #3
0
 static function loadDefaultViewExtensions()
 {
     new ViewExtension("page_elements/foot", "page_elements/footer_menu");
     if (adminLoggedIn()) {
         new ViewExtension("user/buttons", "admin/login_as");
     } else {
         ViewExtension::remove("user/buttons", "admin/login_as");
     }
     return;
 }
Пример #4
0
function removeViewExtension($target, $source)
{
    return ViewExtension::remove($target, $source);
}
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
adminGateKeeper();
$extended_by = NULL;
$body = NULL;
$view_extensions = ViewExtension::getAll();
foreach ($view_extensions as $extension => $variables) {
    $extended_by = NULL;
    foreach ($variables as $variable) {
        $extended_by .= <<<HTML
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extended by:  <strong>{$variable['src']} : {$variable['placement']}</strong> <br/>
HTML;
    }
    $body .= <<<HTML
            <div class="well">
                View:  <strong>{$extension}</strong><br/>
                {$extended_by}
            </div>
HTML;
}
echo display("page_elements/page_header", array("text" => "View Extensions"));