• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP module_installed函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中module_installed函数的典型用法代码示例。如果您正苦于以下问题:PHP module_installed函数的具体用法?PHP module_installed怎么用?PHP module_installed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了module_installed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: smarty_block_module_installed

/**
* Module Installed
*
* Only display the content between the tags if the named module is installed
*
* @param string $name
*
* @return tagdata or FALSE
*/
function smarty_block_module_installed($params, $tagdata, &$smarty, &$repeat)
{
    if (module_installed($params['name'])) {
        return $tagdata;
    } else {
        return '';
    }
}
开发者ID:jnavarroc,项目名称:hero,代码行数:17,代码来源:block.module_installed.php


示例2: search

 /**
  * Search
  *
  * Performs the search and stores results
  *
  * @param string $query
  */
 function search($query = '', $page = 0)
 {
     $this->CI->load->helper('shorten');
     // content search
     $content_types = unserialize(setting('search_content_types'));
     if (!empty($content_types)) {
         $this->CI->load->model('publish/content_model');
         $this->CI->load->model('publish/content_type_model');
         $this->CI->load->model('custom_fields_model');
         foreach ($content_types as $type => $summary_field) {
             $content = $this->CI->content_model->get_contents(array('keyword' => $query, 'type' => $type, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
             if (!empty($content)) {
                 foreach ($content as $item) {
                     // prep summary field
                     if (!empty($summary_field)) {
                         $item['summary'] = shorten(strip_tags($item[$summary_field]), setting('search_trim'), TRUE);
                     }
                     $item['result_type'] = 'content';
                     $this->content_results[$item['id']] = $item;
                     $this->relevance_keys['content|' . $item['id']] = $item['relevance'];
                 }
             }
         }
     }
     // product search
     if (setting('search_products') == '1' and module_installed('store')) {
         $this->CI->load->model('store/products_model');
         $products = $this->CI->products_model->get_products(array('keyword' => $query, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
         if (!empty($products)) {
             foreach ($products as $product) {
                 // prep summary field
                 $product['summary'] = shorten(strip_tags($product['description']), setting('search_trim'), TRUE);
                 $product['result_type'] = 'product';
                 $this->product_results[$product['id']] = $product;
                 $this->relevance_keys['product|' . $product['id']] = $product['relevance'];
             }
         }
     }
     // sort results
     arsort($this->relevance_keys);
     // put together final results array
     foreach ($this->relevance_keys as $item => $relevance) {
         list($type, $id) = explode('|', $item);
         if ($type == 'content') {
             $this->results[] = $this->content_results[$id];
         } elseif ($type == 'product') {
             $this->results[] = $this->product_results[$id];
         }
     }
     // how many total results?
     $this->total_results = count($this->results);
     if ($this->total_results == 0) {
         return array();
     }
     // grab the segment of the array corresponding to our page
     return array_slice($this->results, $page * $this->results_per_page, $this->results_per_page);
 }
开发者ID:Rotron,项目名称:hero,代码行数:64,代码来源:search_results.php


示例3: run

 /**
  * Standard modular run function for search results.
  *
  * @param  string			Search string
  * @param  boolean		Whether to only do a META (tags) search
  * @param  ID_TEXT		Order direction
  * @param  integer		Start position in total results
  * @param  integer		Maximum results to return in total
  * @param  boolean		Whether only to search titles (as opposed to both titles and content)
  * @param  string			Where clause that selects the content according to the main search string (SQL query fragment) (blank: full-text search)
  * @param  SHORT_TEXT	Username/Author to match for
  * @param  ?MEMBER		Member-ID to match for (NULL: unknown)
  * @param  TIME			Cutoff date
  * @param  string			The sort type (gets remapped to a field in this function)
  * @set    title add_date
  * @param  integer		Limit to this number of results
  * @param  string			What kind of boolean search to do
  * @set    or and
  * @param  string			Where constraints known by the main search code (SQL query fragment)
  * @param  string			Comma-separated list of categories to search under
  * @param  boolean		Whether it is a boolean search
  * @return array			List of maps (template, orderer)
  */
 function run($content, $only_search_meta, $direction, $max, $start, $only_titles, $content_where, $author, $author_id, $cutoff, $sort, $limit_to, $boolean_operator, $where_clause, $search_under, $boolean_search)
 {
     unset($author_id);
     unset($limit_to);
     if (!module_installed('catalogues')) {
         return array();
     }
     $remapped_orderer = '';
     switch ($sort) {
         case 'title':
             $remapped_orderer = 'cc_title';
             break;
         case 'add_date':
             $remapped_orderer = 'cc_add_date';
             break;
     }
     require_code('catalogues');
     require_lang('catalogues');
     // Calculate our where clause (search)
     if ($author != '') {
         return array();
     }
     if (!is_null($cutoff)) {
         $where_clause .= ' AND ';
         $where_clause .= 'cc_add_date>' . strval($cutoff);
     }
     if (!$GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())) {
         $where_clause .= ' AND ';
         $where_clause .= 'z.category_name IS NOT NULL';
         $where_clause .= ' AND ';
         $where_clause .= 'p.category_name IS NOT NULL';
     }
     $g_or = _get_where_clause_groups(get_member());
     // Calculate and perform query
     if ($g_or == '') {
         $rows = get_search_rows('catalogue_category', 'id', $content, $boolean_search, $boolean_operator, $only_search_meta, $direction, $max, $start, $only_titles, 'catalogue_categories r', array('r.cc_title', 'r.cc_description'), $where_clause, $content_where, $remapped_orderer, 'r.*');
     } else {
         $rows = get_search_rows('catalogue_category', 'id', $content, $boolean_search, $boolean_operator, $only_search_meta, $direction, $max, $start, $only_titles, 'catalogue_categories r LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'group_category_access z ON (' . db_string_equal_to('z.module_the_name', 'catalogues_category') . ' AND z.category_name=r.id AND ' . str_replace('group_id', 'z.group_id', $g_or) . ') LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'group_category_access p ON (' . db_string_equal_to('p.module_the_name', 'catalogues_catalogue') . ' AND p.category_name=r.c_name AND ' . str_replace('group_id', 'p.group_id', $g_or) . ')', array('r.cc_title', 'r.cc_description'), $where_clause, $content_where, $remapped_orderer, 'r.*');
     }
     $out = array();
     foreach ($rows as $i => $row) {
         $out[$i]['data'] = $row;
         unset($rows[$i]);
         if ($remapped_orderer != '' && array_key_exists($remapped_orderer, $row)) {
             $out[$i]['orderer'] = $row[$remapped_orderer];
         } elseif (substr($remapped_orderer, 0, 7) == '_rating') {
             $out[$i]['orderer'] = $row['compound_rating'];
         }
     }
     return $out;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:74,代码来源:catalogue_categories.php


示例4: admin_preload

 function admin_preload()
 {
     if (module_installed('billing', 'store', 'coupons')) {
         $this->CI->admin_navigation->child_link('reports', 10, 'Invoices', site_url('admincp/reports/invoices'));
         $this->CI->admin_navigation->child_link('reports', 20, 'Product Orders', site_url('admincp/reports/products'));
         $this->CI->admin_navigation->child_link('reports', 30, 'Subscriptions', site_url('admincp/reports/subscriptions'));
         $this->CI->admin_navigation->child_link('reports', 40, 'Cancellations', site_url('admincp/reports/cancellations'));
         $this->CI->admin_navigation->child_link('reports', 50, 'Expirations', site_url('admincp/reports/expirations'));
         $this->CI->admin_navigation->child_link('reports', 55, 'Coupons', site_url('admincp/reports/coupons'));
         $this->CI->admin_navigation->child_link('reports', 60, 'Taxes Received', site_url('admincp/reports/taxes'));
     }
     $this->CI->admin_navigation->child_link('reports', 70, 'Registrations', site_url('admincp/reports/registrations'));
     $this->CI->admin_navigation->child_link('reports', 80, 'Popular Content', site_url('admincp/reports/popular'));
     $this->CI->admin_navigation->child_link('configuration', 100, 'Cronjob', site_url('admincp/reports/cronjob'));
 }
开发者ID:Rotron,项目名称:hero,代码行数:15,代码来源:reports.php


示例5: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('calendar')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'calendar')) {
         return NULL;
     }
     if ($GLOBALS['SITE_DB']->query_value('calendar_events', 'COUNT(*)') == 0) {
         return NULL;
     }
     require_lang('calendar');
     $info = array();
     $info['lang'] = do_lang_tempcode('CALENDAR');
     $info['default'] = false;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:22,代码来源:calendar.php


示例6: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('iotds')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'iotds')) {
         return NULL;
     }
     if ($GLOBALS['SITE_DB']->query_value('iotd', 'COUNT(*)') == 0) {
         return NULL;
     }
     require_lang('iotds');
     $info = array();
     $info['lang'] = do_lang_tempcode('IOTD_ARCHIVE');
     $info['default'] = true;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:22,代码来源:iotds.php


示例7: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('galleries')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'galleries')) {
         return NULL;
     }
     if ($GLOBALS['SITE_DB']->query_value('galleries', 'COUNT(*)') <= 1) {
         return NULL;
     }
     require_lang('galleries');
     $info = array();
     $info['lang'] = do_lang_tempcode('GALLERIES');
     $info['default'] = true;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:22,代码来源:galleries.php


示例8: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('banners')) {
         return NULL;
     }
     require_lang('banners');
     $info = array();
     $info['db_table'] = 'banners';
     $info['db_identifier'] = 'name';
     $info['db_validated'] = 'validated';
     $info['db_add_date'] = 'add_date';
     $info['db_edit_date'] = 'edit_date';
     $info['edit_module'] = 'cms_banners';
     $info['edit_type'] = '_ed';
     $info['edit_identifier'] = 'id';
     $info['title'] = do_lang_tempcode('BANNERS');
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:banners.php


示例9: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('filedump')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'filedump')) {
         return NULL;
     }
     require_code('files2');
     if (count(get_directory_contents(get_custom_file_base() . '/uploads/filedump')) == 0) {
         return NULL;
     }
     require_lang('filedump');
     $info = array();
     $info['lang'] = do_lang_tempcode('FILE_DUMP');
     $info['default'] = false;
     $info['extra_sort_fields'] = array('file_size' => do_lang_tempcode('_FILE_SIZE'));
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:24,代码来源:filedump.php


示例10: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('galleries')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'galleries')) {
         return NULL;
     }
     if ($GLOBALS['SITE_DB']->query_value('images', 'COUNT(*)') == 0) {
         return NULL;
     }
     require_lang('galleries');
     $info = array();
     $info['lang'] = do_lang_tempcode('IMAGES');
     $info['default'] = true;
     $info['category'] = 'cat';
     $info['integer_category'] = false;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:24,代码来源:images.php


示例11: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('downloads')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'downloads')) {
         return NULL;
     }
     if ($GLOBALS['SITE_DB']->query_value('download_downloads', 'COUNT(*)') == 0) {
         return NULL;
     }
     require_lang('downloads');
     $info = array();
     $info['lang'] = do_lang_tempcode('SECTION_DOWNLOADS');
     $info['default'] = true;
     $info['category'] = 'category_id';
     $info['integer_category'] = true;
     $info['extra_sort_fields'] = array('file_size' => do_lang_tempcode('_FILE_SIZE'));
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:25,代码来源:downloads.php


示例12: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('news')) {
         return NULL;
     }
     require_lang('news');
     $info = array();
     $info['db_table'] = 'news';
     $info['db_identifier'] = 'id';
     $info['db_validated'] = 'validated';
     $info['db_title'] = 'title';
     $info['db_title_dereference'] = true;
     $info['db_add_date'] = 'date_and_time';
     $info['db_edit_date'] = 'edit_date';
     $info['edit_module'] = 'cms_news';
     $info['edit_type'] = '_ed';
     $info['edit_identifier'] = 'id';
     $info['title'] = do_lang_tempcode('NEWS');
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:25,代码来源:news.php


示例13: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('galleries')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'galleries')) {
         return NULL;
     }
     if ($GLOBALS['SITE_DB']->query_value('videos', 'COUNT(*)') == 0) {
         return NULL;
     }
     require_lang('galleries');
     $info = array();
     $info['lang'] = do_lang_tempcode('VIDEOS');
     $info['default'] = true;
     $info['category'] = 'cat';
     $info['integer_category'] = false;
     $info['extra_sort_fields'] = array('video_length' => do_lang_tempcode('VIDEO_LENGTH'));
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:25,代码来源:videos.php


示例14: info

 /**
  * Standard modular info function.
  *
  * @return ?array	Map of module info (NULL: module is disabled).
  */
 function info()
 {
     if (!module_installed('cedi')) {
         return NULL;
     }
     require_lang('cedi');
     $info = array();
     $info['db_table'] = 'seedy_posts';
     $info['db_identifier'] = 'id';
     $info['db_validated'] = 'validated';
     $info['db_title'] = 'the_message';
     $info['db_title_dereference'] = true;
     $info['db_add_date'] = 'date_and_time';
     $info['db_edit_date'] = 'edit_date';
     $info['edit_module'] = 'cedi';
     $info['edit_type'] = 'post';
     $info['edit_identifier'] = 'post_id';
     $info['title'] = do_lang_tempcode('CEDI');
     $info['is_minor'] = true;
     return $info;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:26,代码来源:cedi.php


示例15: get_possible_links

 function get_possible_links($menu_id)
 {
     // Each "possible link" must have the following 3 attributes:
     // - Text (display text)
     // - Type (content type, not used technically but just to show what type of content it is)
     // - Code (a base64_encoded, serialized array of data including:
     //		- link_type (either "link" or "special),
     //		- link_id (if in universal `links` table and link_type == "link"),
     //		- special_type (if link_type == "special")
     $possible_links = array();
     // get current links so we can prevent duplicates
     $this->load->model('menu_model');
     $current_links = $this->menu_model->get_links(array('menu' => $this->session->userdata('manage_menu_id'), 'parent' => $this->session->userdata('manage_menu_parent_link_id')));
     // add special links
     $special_links = array('home' => 'Home', 'control_panel' => 'Control Panel', 'my_account' => 'My Account', 'search' => 'Search');
     if (module_installed('store')) {
         $special_links['store'] = 'Store';
         $special_links['cart'] = 'Shopping Cart';
     }
     if (module_installed('billing')) {
         $special_links['subscriptions'] = 'Subscription Plans';
     }
     foreach ($special_links as $special_link_code => $special_link_name) {
         if (!$this->special_link_in_array($current_links, $special_link_code)) {
             $possible_links[] = array('text' => $special_link_name, 'type' => 'Special', 'code' => base64_encode(serialize(array('special_type' => $special_link_code, 'link_type' => 'special', 'link_text' => $special_link_name))));
         }
     }
     // get all content links from the universal link database
     $this->load->model('link_model');
     $links = $this->link_model->get_links();
     foreach ((array) $links as $link) {
         if (!$this->universal_link_in_array($current_links, $link['id'])) {
             $possible_links[] = array('text' => $link['title'], 'type' => $link['type'], 'code' => base64_encode(serialize(array('link_id' => $link['id'], 'link_type' => 'link', 'link_text' => $link['title']))));
         }
     }
     return $possible_links;
 }
开发者ID:Rotron,项目名称:hero,代码行数:37,代码来源:admincp.php


示例16: __construct

 function __construct()
 {
     parent::__construct();
     // by defining _CONTROLPANEL, certain functionality can be modified to be appropriate to this context
     define("_CONTROLPANEL", "TRUE");
     // load the SSL helper, and redirect to HTTPS if necessary (or to HTTP)
     $this->load->helper('ssl');
     // load notices library (display success/error messages at top of screen)
     $this->load->library('notices');
     $this->load->helper('admincp/get_notices');
     // are they logged in? and an administrator?
     if ($this->user_model->logged_in() and !$this->user_model->is_admin()) {
         $this->notices->SetError('You are logged in but do not have control panel privileges.');
         redirect(site_url('admincp/login'));
         die;
     } elseif (!$this->user_model->logged_in() and $this->router->fetch_class() != 'login') {
         redirect(site_url('admincp/login'));
         die;
     }
     // store dynamically-generated navigation
     $this->load->library('admin_navigation');
     // add basic navigation categories
     $this->admin_navigation->parent_link('dashboard', 'Dashboard');
     $this->admin_navigation->parent_link('publish', 'Publish');
     if (module_installed('store') or module_installed('billing') or module_installed('coupons')) {
         $this->admin_navigation->parent_link('storefront', 'Storefront');
     }
     $this->admin_navigation->parent_link('members', 'Members');
     $this->admin_navigation->parent_link('reports', 'Reports');
     $this->admin_navigation->parent_link('design', 'Design');
     $this->admin_navigation->parent_link('configuration', 'Configuration');
     $this->admin_navigation->child_link('dashboard', 1, 'Dashboard', site_url('admincp'));
     // admin-specific loading
     $this->load->helper('admincp/dataset_link');
     $this->load->helper('directory');
     $this->load->helper('form');
     $this->load->helper('admincp/admin_link');
     // load assets library (include stylesheets and javascript files dynamically)
     $this->load->library('head_assets');
     // load caching library
     $this->load->driver('cache');
     // init hooks
     $this->load->library('app_hooks');
     // load all modules with control panel to build navigation, etc.
     $modules = $this->module_model->get_module_folders();
     // first, reset module definitions so that we run them all as a "backend" call and their preloads get called
     $this->module_definitions = new stdClass();
     foreach ($modules as $module) {
         MY_Loader::define_module($module . '/');
     }
     // define WYSIWYG session variables for file uploading
     @session_start();
     $_SESSION['KCFINDER'] = array();
     $_SESSION['KCFINDER']['disabled'] = FALSE;
     // Safari base_href fix
     $url = parse_url(base_url());
     $this->load->library('user_agent');
     // if they are using Safari and don't have Hero installed in a sub-folder, this prefix "/" fixes the problem
     if (stripos($this->agent->browser(), 'safari') !== FALSE and trim($url['path'], '/') == '') {
         $prefix = '/';
     } else {
         $prefix = '';
     }
     $_SESSION['KCFINDER']['uploadURL'] = $prefix . str_replace(FCPATH, '', setting('path_editor_uploads'));
     $_SESSION['KCFINDER']['uploadDir'] = rtrim(setting('path_editor_uploads'), '/');
     // check cronjob is active!
     if (setting('cron_last_update') == FALSE or time() - strtotime(setting('cron_last_update')) > 60 * 60 * 24) {
         $this->notices->SetError('WARNING!  Your cronjob is not running properly.  <a href="' . site_url('admincp/reports/cronjob') . '">Click here for details</a>');
     }
 }
开发者ID:Rotron,项目名称:hero,代码行数:70,代码来源:Admincp_Controller.php


示例17: parse_links

function parse_links(&$menu_items, &$menu_children, $links, $menu, &$smarty, $params)
{
    if (empty($links)) {
        return FALSE;
    }
    foreach ($links as $link) {
        $display_this_item = TRUE;
        if ($link['privileges']) {
            if (!$smarty->CI->user_model->in_group($link['privileges'])) {
                $display_this_item = FALSE;
            }
        }
        if ($display_this_item == TRUE) {
            if ($link['special_type'] == FALSE) {
                // calculate URL
                if ($link['external_url']) {
                    if (strstr($link['external_url'], ':')) {
                        // full http:// URL
                        $url = $link['external_url'];
                    } else {
                        $url = site_url($link['external_url']);
                    }
                } else {
                    // it's in the universal links database, and we have link_url_path
                    $url = site_url($link['link_url_path']);
                }
                // is it active?
                $active = FALSE;
                if ($link['external_url'] == TRUE and current_url() == $url) {
                    $active = TRUE;
                } elseif ($link['external_url'] == FALSE and trim($smarty->CI->uri->uri_string, '/') == trim($link['link_url_path'], '/')) {
                    $active = TRUE;
                }
                $menu_items[$link['id']] = array('text' => $link['text'], 'url' => $url, 'active' => $active, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
            } else {
                // it's a special link
                if ($link['special_type'] == 'home') {
                    $menu_items[$link['id']] = array('text' => $link['text'], 'url' => site_url(), 'active' => $smarty->CI->uri->segment(1) == FALSE ? TRUE : FALSE, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
                } elseif ($link['special_type'] == 'control_panel') {
                    $menu_items[$link['id']] = array('text' => $link['text'], 'url' => site_url('admincp'), 'active' => $smarty->CI->uri->segment(1) == 'admincp' ? TRUE : FALSE, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
                } elseif ($link['special_type'] == 'my_account') {
                    $menu_items[$link['id']] = array('text' => $link['text'], 'url' => site_url('users'), 'active' => $smarty->CI->uri->segment(1) == 'users' ? TRUE : FALSE, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
                    if ($smarty->CI->user_model->logged_in() and $link['parent_menu_link_id'] == '0' and ($params['show_sub_menus'] == 'yes' or $params['show_sub_menus'] == 'active' and $menu_items[$link['id']] == TRUE)) {
                        // add children
                        $menu_children[$link['id']][] = 'profile';
                        $menu_children[$link['id']][] = 'password';
                        if (module_installed('billing')) {
                            $menu_children[$link['id']][] = 'invoices';
                        }
                        $menu_children[$link['id']][] = 'logout';
                        $menu_items['profile'] = array('text' => 'Update Profile', 'url' => site_url('users/profile'), 'active' => ($smarty->CI->uri->segment(1) == 'users' and $smarty->CI->uri->segment(2) == 'profile') ? TRUE : FALSE, 'class' => 'account_profile', 'is_child' => TRUE);
                        $menu_items['password'] = array('text' => 'Change Password', 'url' => site_url('users/password'), 'active' => ($smarty->CI->uri->segment(1) == 'users' and $smarty->CI->uri->segment(2) == 'password') ? TRUE : FALSE, 'class' => 'account_password', 'is_child' => TRUE);
                        if (module_installed('billing')) {
                            $menu_items['invoices'] = array('text' => 'View Invoices', 'url' => site_url('users/invoices'), 'active' => ($smarty->CI->uri->segment(1) == 'users' and $smarty->CI->uri->segment(2) == 'invoices') ? TRUE : FALSE, 'class' => 'account_invoices', 'is_child' => TRUE);
                        }
                        $menu_items['logout'] = array('text' => 'Logout', 'url' => site_url('users/logout'), 'active' => ($smarty->CI->uri->segment(1) == 'users' and $smarty->CI->uri->segment(2) == 'logout') ? TRUE : FALSE, 'class' => 'account_logout', 'is_child' => TRUE);
                    }
                } elseif ($link['special_type'] == 'store' and module_installed('store')) {
                    $menu_items[$link['id']] = array('text' => $link['text'], 'url' => site_url('store'), 'active' => ($smarty->CI->uri->segment(1) == 'store' or $smarty->CI->uri->segment(1) == 'checkout') ? TRUE : FALSE, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
                } elseif ($link['special_type'] == 'search') {
                    $menu_items[$link['id']] = array('text' => $link['text'], 'url' => site_url('search'), 'active' => $smarty->CI->uri->segment(1) == 'search' ? TRUE : FALSE, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
                } elseif ($link['special_type'] == 'subscriptions' and module_installed('billing')) {
                    $menu_items[$link['id']] = array('text' => $link['text'], 'url' => site_url('subscriptions'), 'active' => $smarty->CI->uri->segment(1) == 'subscriptions' ? TRUE : FALSE, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
                } elseif ($link['special_type'] == 'cart') {
                    $menu_items[$link['id']] = array('text' => $link['text'], 'url' => site_url('users'), 'active' => $smarty->CI->uri->segment(1) == 'cart' ? TRUE : FALSE, 'class' => $link['class'], 'is_child' => $link['parent_menu_link_id'] != '0' ? TRUE : FALSE);
                }
            }
            // should we load children?
            // only if show_sub_menus parameter says so, and this isn't already a child link
            if ($link['parent_menu_link_id'] == '0' and ($params['show_sub_menus'] == 'yes' or $params['show_sub_menus'] == 'active' and $menu_items[$link['id']] == TRUE)) {
                // load children
                $links_children = $smarty->CI->menu_model->get_links(array('menu' => $menu['id'], 'parent' => $link['id']));
                if (is_array($links_children)) {
                    // track children
                    foreach ($links_children as $link_child) {
                        $menu_children[$link['id']][] = $link_child['id'];
                    }
                    parse_links($menu_items, $menu_children, $links_children, $menu, $smarty, $params);
                }
            }
        }
    }
}
开发者ID:Rotron,项目名称:hero,代码行数:83,代码来源:function.menu.php


示例18: install_location_data

function install_location_data()
{
    if (!module_installed('admin_locations')) {
        require_code('zones2');
        reinstall_module('adminzone', 'admin_locations');
    }
    require_code('files');
    require_code('locations');
    // Open WorldGazetteer.csv
    $myfile = fopen(get_file_base() . '/data_custom/locations/WorldGazetteer.csv', 'rb');
    $header = fgetcsv($myfile, 4096);
    $locations = array();
    while (($line = fgetcsv($myfile, 4096)) !== false) {
        $newline = array();
        foreach ($header as $i => $h) {
            $newline[$h] = isset($line[$i]) ? $line[$i] : '';
        }
        if ($newline['Latitude'] != '') {
            $newline['Latitude'] = float_to_raw_string(floatval($newline['Latitude']) / 100.0);
            $newline['Longitude'] = float_to_raw_string(floatval($newline['Longitude']) / 100.0);
        }
        // Fix inconsistencies
        $newline['Country'] = preg_replace('#^(Smaller|External) Territories of (the )?#', '', $newline['Country']);
        if ($newline['Country'] == 'UK') {
            $newline['Country'] = 'United Kingdom';
        }
        if ($newline['Country'] == 'Reunion') {
            $newline['Country'] = 'France';
        }
        $locations[] = $newline;
    }
    // Load US locations using CivicSpace-zipcodes.csv
    require_code('locations/us');
    $myfile = fopen(get_file_base() . '/data_custom/locations/CivicSpace-zipcodes.csv', 'rb');
    $header = fgetcsv($myfile, 4096);
    $us_locations = array();
    while (($line = fgetcsv($myfile, 4096)) !== false) {
        $newline = array();
        foreach ($header as $i => $h) {
            $newline[$h] = isset($line[$i]) ? $line[$i] : '';
        }
        $state_name = state_code_to_state_name($newline['state']);
        $us_locations[$state_name][$newline['city']] = $newline;
    }
    // Load World locations using World_Cities_Location_table.csv
    require_code('locations/us');
    $myfile = fopen(get_file_base() . '/data_custom/locations/World_Cities_Location_table.csv', 'rb');
    $header = fgetcsv($myfile, 4096);
    $world_locations = array();
    while (($line = fgetcsv($myfile, 4096)) !== false) {
        $newline = array();
        foreach ($header as $i => $h) {
            $newline[$h] = isset($line[$i]) ? $line[$i] : '';
        }
        // Fix inconsistencies
        if ($newline['Country'] == 'United States') {
            $newline['Country'] = 'United States of America';
        }
        $world_locations[$newline['Country']][$newline['City']] = $newline;
    }
    // Delete current data
    $GLOBALS['SITE_DB']->query_delete('locations');
    // Merge it all together, and put it into DB
    foreach ($locations as $location) {
        if ($location['Latitude'] == '') {
            if ($location['Country'] == 'United States of America' && $location['Type'] == 'locality') {
                // Get match for latitude / longitude in CivicSpace-zipcodes.csv
                if (isset($us_locations[$location['Parent1']][$location['Name']])) {
                    $us_location = $us_locations[$location['Parent1']][$location['Name']];
                    $location['Latitude'] = $us_location['latitude'];
                    $location['Longitude'] = $us_location['longitude'];
                }
            }
        }
        if ($location['Latitude'] == '') {
            // Get match for latitude / longitude in World_Cities_Location_table.csv
            if (isset($world_locations[$location['Country']][$location['Name']])) {
                $world_location = $world_locations[$location['Country']][$location['Name']];
                $location['Latitude'] = $world_location['Latitude'];
                $location['Longitude'] = $world_location['Longitude'];
            }
        }
        $GLOBALS['SITE_DB']->query_insert('locations', array('l_place' => $location['Name'], 'l_type' => $location['Type'], 'l_continent' => find_continent($location['Country']), 'l_country' => $location['Country'], 'l_parent_1' => $location['Parent1'], 'l_parent_2' => $location['Parent2'], 'l_parent_3' => $location['Parent3'], 'l_population' => intval($location['Population']), 'l_latitude' => $location['Latitude'] == '' ? NULL : floatval($location['Latitude']), 'l_longitude' => $location['Longitude'] == '' ? NULL : floatval($location['Longitude'])));
    }
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:85,代码来源:locations_install.php


示例19: modules

 public function modules($name = null, $subpage = null)
 {
     // Make sure the user can view this page
     if (!$this->check_permission('manage_modules')) {
         return;
     }
     if ($name != null) {
         // Make sure the module is installed!
         if (module_installed($name)) {
             // Load the module controller
             $file = path(ROOT, "third_party", "modules", $name, "admin.php");
             if (file_exists($file)) {
                 // Load the file
                 include $file;
                 // Init the module into a variable
                 $class = ucfirst($name);
                 $module = new $class(true);
                 // Correct the module view path'
                 $this->Template->set_controller($class, true);
                 // Build our page title / desc, then load the view
                 $this->Template->set('page_title', $class . " Config");
                 $this->Template->set('page_desc', "On this page, you can configure this module.");
                 // Run the module installer
                 $result = $module->admin();
                 if ($result == false) {
                     // Correct the module view path'
                     $this->Template->set_controller('Admin', false);
                     // Build our page title / desc, then load the view
                     $this->Template->set('page_title', "Error Loading Module");
                     $this->Template->set('page_desc', "");
                     $this->load->view('module_load_error');
                     return;
                 }
             }
         }
     } else {
         $data = array("page_title" => "Module Management", "page_desc" => "On this page, you can install and manage your installed modules. You may also edit module config files here.");
         $this->load->view("module_index", $data);
     }
 }
开发者ID:Kheros,项目名称:Plexis,代码行数:40,代码来源:admin.php


示例20: setting

<?php

echo $this->head_assets->javascript('js/dashboard.js');
echo $this->head_assets->javascript('js/jquery.sparkline.js');
echo $this->head_assets->stylesheet('css/dashboard.css');
?>

<?php 
echo $this->load->view(branded_view('cp/header.php'));
?>

<?php 
if (module_installed('billing', 'store', 'coupons')) {
    ?>
	<div id="dash_stats" rel="day">
		<div id="date_selector">
			<ul>
				<li><input type="radio" name="date_select" value="day" /> <span>Today</span></li>
				<li><input type="radio" name="date_select" value="week" /> <span>This Week</span></li>
				<li><input type="radio" name="date_select" value="month" /> <span>This Month</span></li>
			</ul>
		</div>
		<div class="stat">
			<div class="wrap">
			<span class="stat day"><?php 
    echo setting('currency_symbol');
    echo $day['revenue'];
    ?>
</span>
			<span class="stat week"><?php 
    echo setting('currency_symbol');
开发者ID:jnavarroc,项目名称:hero,代码行数:31,代码来源:dashboard.php



注:本文中的module_installed函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP module_invoke函数代码示例发布时间:2022-05-15
下一篇:
PHP module_implements函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap