/**
 * Ossn view widget
 *
 * @param string $name
 * @param string $title
 * @return mix data
 */
function ossn_view_widget($name, $title, $contents)
{
    $theme = new OssnThemes();
    $active_theme = $theme->getActive();
    $widget['title'] = $title;
    $widget['contents'] = $contents;
    return ossn_view("themes/{$active_theme}/widgets/{$name}", $widget);
}
예제 #2
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$theme = input('theme');
$delete = new OssnThemes();
if (strtolower($delete->getActive()) == strtolower($theme)) {
    ossn_trigger_message(ossn_print('theme:delete:active'), 'error');
    redirect(REF);
}
if ($delete->deletetheme($theme)) {
    ossn_trigger_message(ossn_print('theme:deleted'), 'success');
    redirect(REF);
} else {
    ossn_trigger_message(ossn_print('theme:delete:error'), 'error');
    redirect(REF);
}
    $com = new OssnComponents();
    return $com->total();
}
/**
 * Load the locales
 *
 * @return array
 */
ossn_default_load_locales();
/**
 * Includes all components and active theme
 *
 * @return bool
 */
//loads active theme
$theme = new OssnThemes();
$theme->loadActive();
//load active components
$coms = new OssnComponents();
$coms->loadComs();
/**
 * Initialize components
 *
 * @return false|null
 * @access private;
 */
function ossn_components_init()
{
    $panels = ossn_registered_com_panel();
    if (!$panels) {
        return false;
    $com = new OssnComponents();
    return $com->total();
}
/**
 * Load the locales
 *
 * @return array
 */
ossn_default_load_locales();
/**
 * Includes all components and active theme
 *
 * @return bool
 */
//loads active theme
$themes = new OssnThemes();
include_once $themes->getActivePath();
//load active components
$coms = new OssnComponents();
$coms->loadComs();
/**
 * Initialize components
 *
 * @return false|null
 * @access private;
 */
function ossn_components_init()
{
    $panels = ossn_registered_com_panel();
    if (!$panels) {
        return false;
/**
 * Count total themes
 *
 * @return (int)
 */
function ossn_site_total_themes()
{
    $themes = new OssnThemes();
    return $themes->total();
}
예제 #6
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$themes = new OssnThemes();
$translit = OssnTranslit::urlize($params['theme']->name);
if (empty($params['theme']->name)) {
    $translit = rand();
}
$id = $params['id'];
$requirements = $themes->checkRequirments($params['theme']);
if (ossn_site_settings('theme') !== $id) {
    $enable = ossn_site_url("action/theme/enable?theme={$id}", true);
    $enable = "<a href='{$enable}' class='btn btn-success'><i class='fa fa-check'></i>" . ossn_print('admin:button:enable') . "</a>";
    $delete = ossn_site_url("action/theme/delete?theme={$id}", true);
    $delete = "<a href='{$delete}' class='btn btn-danger'><i class='fa fa-close'></i>" . ossn_print('admin:button:delete') . "</a>";
}
?>
 	
    <div class="panel panel-default margin-top-10">
      <div class="panel-heading">
        <h4 class="panel-title">
          <a data-parent="#accordion" href="#collapse-<?php 
echo $translit;
예제 #7
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
?>
<div class="panel-group" id="accordion">
   	<?php 
$themes = new OssnThemes();
$list = $themes->getThemes();
if ($list) {
    foreach ($list as $id) {
        $vars = array();
        $vars['OssnThemes'] = $themes;
        $vars['id'] = $id;
        $vars['theme'] = $themes->getTheme($id);
        echo ossn_plugin_view("admin/themes/list/item", $vars);
    }
}
?>
</div> 
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
$OssnTheme = new OssnThemes();
if ($OssnTheme->upload()) {
    ossn_trigger_message(ossn_print('theme:installed'));
    redirect(REF);
} else {
    ossn_trigger_message(ossn_print('theme:install:error'), 'error');
    redirect(REF);
}
예제 #9
0
/**
 * Fetch a layout;
 *
 * @last edit: $arsalanshah
 * @Reason: Initial;
 *
 * @param string $layout
 */
function ossn_set_page_layout($layout, $params = array())
{
    if (!empty($layout)) {
        $theme = new OssnThemes();
        $active_theme = $theme->getActive();
        return ossn_plugin_view("theme/page/layout/{$layout}", $params);
    }
}
예제 #10
0
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
$theme = input('theme');
$enable = new OssnThemes();
if ($enable->Enable($theme)) {
    ossn_trigger_message(ossn_print('theme:enabled'), 'success');
    redirect(REF);
}
예제 #11
0
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
$OssnThemes = new OssnThemes();
foreach ($OssnThemes->getThemes() as $id) {
    $Theme = $OssnThemes->getTheme($id);
    echo "<div class='ossn-components-item'>";
    echo "<div class='component-controls'>";
    if (ossn_site_settings('theme') == $id) {
        echo "<a href='#' class='components-button components-button-blue'>" . ossn_print('admin:button:enabled') . "</a>";
    } else {
        $enable = ossn_site_url("action/theme/enable?theme={$id}", true);
        echo "<a href='{$enable}' class='components-button components-button-green'>" . ossn_print('admin:button:enable') . "</a>";
    }
    if ($OssnThemes->getActive() !== $id) {
        $delete = ossn_site_url("action/theme/delete?theme={$id}", true);
        echo "<a href='{$delete}' class='components-button components-button-red'>" . ossn_print('admin:button:delete') . "</a>";
    }
    echo "</div>";
    echo "<div class='component-name'>{$Theme->theme_name} {$Theme->theme_version}</div>";
    echo "<div class='compontnet-meta'>\n\t        \t" . ossn_print('admin:component:author') . ": {$Theme->theme_author}<br />\n\t\t\t\t" . ossn_print('admin:component:website') . ": {$Theme->theme_author_url}\n\t </div>";
    echo "<div class='component-description'>{$Theme->theme_description}</div>";
    echo '</div>';
예제 #12
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$enable = new OssnThemes();
$theme = input('theme');
$cache_flush = input('flush_cache', '', false);
$cache = ossn_site_settings('cache');
if (!$cache_flush && $enable->Enable($theme)) {
    ossn_trigger_message(ossn_print('theme:enabled'), 'success');
    if ($cache == false) {
        redirect(REF);
    } else {
        //redirect and flush cache
        $page = "action/theme/enable?flush_cache=1";
        $page = ossn_add_tokens_to_url($page);
        redirect($page);
    }
}
if ($cache_flush) {
    if (ossn_disable_cache()) {
        if (ossn_create_cache()) {
            redirect('administrator/themes');
        }