/** * Initialize components * * @return false|null * @access private; */ function ossn_components_init() { $panels = ossn_registered_com_panel(); if (!$panels) { return false; } foreach ($panels as $configure) { ossn_register_menu_item('topbar_admin', array('name' => OssnTranslit::urlize($configure), 'text' => $configure, 'parent' => 'configure', 'href' => ossn_site_url("administrator/component/{$configure}"))); } }
/** * Upload component * * Requires component package file, * * @return boolean */ public function upload() { $archive = new ZipArchive(); $data_dir = ossn_get_userdata('tmp/components'); if (!is_dir($data_dir)) { mkdir($data_dir, 0755, true); } $zip = $_FILES['com_file']; $newfile = "{$data_dir}/{$zip['name']}"; if (move_uploaded_file($zip['tmp_name'], $newfile)) { if ($archive->open($newfile) === TRUE) { $translit = OssnTranslit::urlize($zip['name']); //make community components works on installer #394 //Component installer problems with certain zip - archives #420 $archive->extractTo($data_dir . '/' . $translit); $dirctory = scandir($data_dir . '/' . $translit, 1); $dirctory = $dirctory[0]; $files = $data_dir . '/' . $translit . '/' . $dirctory . '/'; $archive->close(); if (is_dir($files) && is_file("{$files}ossn_com.php") && is_file("{$files}ossn_com.xml")) { $ossn_com_xml = simplexml_load_file("{$files}ossn_com.xml"); //need to check id , since ossn v3.x if (isset($ossn_com_xml->id) && !empty($ossn_com_xml->id)) { //move to components directory if (OssnFile::moveFiles($files, ossn_route()->com . $ossn_com_xml->id . '/')) { //add new component to system $this->newCom($ossn_com_xml->id); //why it shows success even if the component is not updated #510 OssnFile::DeleteDir($data_dir); return true; } } } } } return false; }
<?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 */ $menus = $params['menu']; echo "<div class='ossn-menu-search'>"; echo '<div class="title">' . ossn_print('result:type') . '</div>'; foreach ($menus as $menu => $val) { foreach ($val as $link) { $text = ossn_print($link['text']); $link = $link['href']; $class = OssnTranslit::urlize($menu); echo "<li class='ossn-menu-search-{$class}'>\r\n\t\t\t\t<a href='{$link}'>\r\n\t\t\t\t\t<div class='text'>{$text}</div>\r\n\t\t\t\t</a>\r\n\t\t\t</li>"; } } echo '</div>';
<?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;
<?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 */ $OssnComs = new OssnComponents(); $translit = OssnTranslit::urlize($params['component']->id); if (empty($params['component']->name)) { $translit = rand(); } $requirements = $OssnComs->checkRequirments($params['component']); //used code from ossn v1.0 if (!$params['OssnCom']->isActive($params['name'])) { $enable = ossn_site_url("action/component/enable?com={$params['name']}", true); $enable = "<a href='{$enable}' class='btn btn-success'><i class='fa fa-check'></i>" . ossn_print('admin:button:enable') . "</a>"; } elseif (!in_array($params['name'], $params['OssnCom']->requiredComponents())) { $disable = ossn_site_url("action/component/disable?com={$params['name']}", true); $disable = "<a href='{$disable}' class='btn btn-warning'><i class='fa fa-minus'></i>" . ossn_print('admin:button:disable') . "</a>"; } if (in_array($params['name'], ossn_registered_com_panel())) { $configure = ossn_site_url("administrator/component/{$params['name']}"); $configure = "<a href='{$configure}' class='btn btn-primary'><i class='fa fa-cogs'></i>" . ossn_print('admin:button:configure') . "</a>"; } if (!in_array($params['name'], $params['OssnCom']->requiredComponents())) { $delete = ossn_site_url("action/component/delete?component={$params['name']}", true);