當前位置: 首頁>>代碼示例>>PHP>>正文


PHP is_module_enabled函數代碼示例

本文整理匯總了PHP中is_module_enabled函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_module_enabled函數的具體用法?PHP is_module_enabled怎麽用?PHP is_module_enabled使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了is_module_enabled函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create

 public static function create(array $data = [])
 {
     if (is_module_enabled('Site')) {
         $siteId = Site::id();
         $data['site_id'] = $siteId;
     }
     return parent::create($data);
 }
開發者ID:bitsoflove,項目名稱:Page,代碼行數:8,代碼來源:Page.php

示例2: newQuery

 public function newQuery()
 {
     $query = parent::newQuery();
     if (is_module_enabled('Site')) {
         $this->appendWhereClause($query);
     }
     return $query;
 }
開發者ID:bitsoflove,項目名稱:Media,代碼行數:8,代碼來源:MultiSiteTenancyTrait.php

示例3: create

 public function create($data)
 {
     if (is_module_enabled('Site')) {
         $siteId = Site::id();
         $data['site_id'] = $siteId;
     }
     $menu = $this->model->create($data);
     event(new MenuWasCreated($menu));
     return $menu;
 }
開發者ID:bitsoflove,項目名稱:Menu,代碼行數:10,代碼來源:EloquentMenuRepository.php

示例4: edit

 public function edit(Menu $menu)
 {
     $menuItems = $this->menuItem->allRootsForMenu($menu->id);
     $menuStructure = $this->menuRenderer->renderForMenu($menu->id, $menuItems->nest());
     $data = compact('menu', 'menuStructure');
     if (is_module_enabled('Site')) {
         $data['supportedLocales'] = \Site::current()->siteLocales->lists('title', 'locale')->toArray();
     }
     return view('menu::admin.menus.edit', $data);
 }
開發者ID:bitsoflove,項目名稱:Menu,代碼行數:10,代碼來源:MenuController.php

示例5: handle

 public function handle($request, Closure $next)
 {
     //check if multi site tenancy is on, and if not, execute the original logic
     if (!is_module_enabled('Site')) {
         $original = \App::make('Mcamara\\LaravelLocalization\\Middleware\\LaravelLocalizationRedirectFilter');
         return $original->handle($request, $next);
     }
     $this->setAdminOrSiteLocale();
     return $next($request);
 }
開發者ID:bitsoflove,項目名稱:Core,代碼行數:10,代碼來源:LocalizationMiddleware.php

示例6: newQuery

 public function newQuery()
 {
     $query = parent::newQuery();
     if (is_module_enabled('Site')) {
         $this->appendSiteWhereClause($query);
     }
     if (empty($this->auth->check())) {
         $this->appendPublicWhereClause($query);
     }
     return $query;
 }
開發者ID:bitsoflove,項目名稱:Page,代碼行數:11,代碼來源:QueryLimiterTrait.php

示例7: createFromFile

 /**
  * Create a file row from the given file
  * @param  UploadedFile $file
  * @return mixed
  */
 public function createFromFile(UploadedFile $file)
 {
     $fileName = FileHelper::slug($file->getClientOriginalName());
     $exists = $this->model->whereFilename($fileName)->first();
     if ($exists) {
         $fileName = $this->getNewUniqueFilename($fileName);
     }
     $data = ['filename' => $fileName, 'path' => config('asgard.media.config.files-path') . "{$fileName}", 'extension' => substr(strrchr($fileName, "."), 1), 'mimetype' => $file->getClientMimeType(), 'filesize' => $file->getFileInfo()->getSize(), 'folder_id' => 0];
     if (is_module_enabled('Site')) {
         $siteId = Site::id();
         $data['site_id'] = $siteId;
         $data['path'] = config('asgard.media.config.files-path') . '/' . Site::current()->slug . "/{$fileName}";
     }
     return $this->model->create($data);
 }
開發者ID:bitsoflove,項目名稱:Media,代碼行數:20,代碼來源:EloquentFileRepository.php

示例8: setActiveTheme

 /**
  * Set the active theme based on the settings
  */
 private function setActiveTheme()
 {
     if ($this->app->runningInConsole() || !app('asgard.isInstalled')) {
         return;
     }
     if ($this->inAdministration()) {
         $themeName = $this->app['config']->get('asgard.core.core.admin-theme');
         return $this->app['stylist']->activate($themeName, true);
     }
     //if multi site, then grab themeName from db
     if (is_module_enabled('Site')) {
         $currentLocale = \Site::currentLocale();
         //if(!empty($currentLocale)) {
         $themeName = $currentLocale->theme;
         //} else {
         //    \Log::warning('Invalid locale defined! ThemeServiceProvider@setActiveTeam');
         //    $themeName = $this->app['setting.settings']->get('core::template', null, 'Flatly');
         //}
     } else {
         $themeName = $this->app['setting.settings']->get('core::template', null, 'Flatly');
     }
     return $this->app['stylist']->activate($themeName, true);
 }
開發者ID:bitsoflove,項目名稱:Setting,代碼行數:26,代碼來源:ThemeServiceProvider.php

示例9: is_mib_poller_enabled

function is_mib_poller_enabled($device)
{
    $val = get_dev_attrib($device, 'poll_mib');
    if ($val == null) {
        return is_module_enabled('poller', 'mib');
    }
    return $val;
}
開發者ID:greggcz,項目名稱:librenms,代碼行數:8,代碼來源:common.php

示例10: env

	@endforeach

    <!-- Mainly scripts -->
    {!! Theme::script('js/bootstrap.min.js') !!}
    {!! Theme::script('js/plugins/metisMenu/jquery.metisMenu.js') !!}
    {!! Theme::script('js/plugins/slimscroll/jquery.slimscroll.min.js') !!}

    {!! Theme::script('vendor/alertify/build/alertify.min.js') !!}
    {!! Theme::script('js/mousetrap.min.js') !!}
    {!! Theme::script('js/jquery.slug.js') !!}

    <!-- Custom and plugin javascript -->
    {!! Theme::script('js/inspinia.js') !!}
	
	<?php 
if (is_module_enabled('Notification')) {
    ?>
	    <script src="https://js.pusher.com/3.0/pusher.min.js"></script>
	    <script src="{{ Module::asset('notification:js/pusherNotifications.js') }}"></script>
	    <script>
	        $(".notifications-list").pusherNotifications({
	            pusherKey: '{{ env('PUSHER_KEY') }}',
	            loggedInUserId: {{ $currentUser->id }}
	        });
	    </script>
	<?php 
}
?>

	@section('scripts')
	@show
開發者ID:notegame,項目名稱:asgardcms,代碼行數:31,代碼來源:master.blade.php

示例11: createAll

 /**
  * Create all thumbnails for the given image path
  * @param string $path
  */
 public function createAll($path)
 {
     if (!$this->isImage($path)) {
         return;
     }
     foreach ($this->manager->all() as $thumbnail) {
         $image = $this->image->make($this->filesystem->disk($this->getConfiguredFilesystem())->get($this->getDestinationPath($path->getRelativeUrl())));
         if (is_module_enabled('Site')) {
             $filename = config('asgard.media.config.files-path') . Site::current()->slug . '/' . $this->newFilename($path, $thumbnail->name());
         } else {
             $filename = config('asgard.media.config.files-path') . $this->newFilename($path, $thumbnail->name());
         }
         foreach ($thumbnail->filters() as $manipulation => $options) {
             $image = $this->imageFactory->make($manipulation)->handle($image, $options);
         }
         $image = $image->stream(pathinfo($path, PATHINFO_EXTENSION));
         $this->writeImage($filename, $image);
     }
 }
開發者ID:bitsoflove,項目名稱:Media,代碼行數:23,代碼來源:Imagy.php

示例12: array

if (isAuthorized('viewServers')) {
    $menu['servers_child'] = array('id' => 'servers_child', 'name' => _('Servers'), 'page' => 'servers.php', 'parent' => array('servers'));
    $menu['servers_unregistered'] = array('id' => 'servers_unregistered', 'name' => _('Unregistered Servers'), 'page' => 'servers.php?view=unregistered', 'parent' => array('servers'));
    $menu['servers_groups'] = array('id' => 'servers_groups', 'name' => _('Server Groups'), 'page' => 'serversgroup.php', 'parent' => array('servers'));
}
if (isAuthorized('viewSharedFolders')) {
    if (is_module_enabled('SharedFolderDB')) {
        $menu['sharedfolders'] = array('id' => 'sharedfolders', 'name' => _('Shared Folders'), 'page' => 'sharedfolders.php', 'parent' => array('servers'));
    }
}
if (isAuthorized('viewScripts')) {
    $menu['script'] = array('id' => 'script', 'name' => _('Login Scripts'), 'page' => 'script.php', 'parent' => array('servers'));
}
if (isAuthorized('viewSharedFolders')) {
    // it should be viewProfile
    if (is_module_enabled('ProfileDB')) {
        $menu['profile'] = array('id' => 'profiles', 'name' => _('Profiles'), 'page' => 'profiles.php', 'parent' => array('servers'));
    }
}
if (isAuthorized('viewUsers')) {
    $menu['user_child'] = array('id' => 'user_child', 'name' => _('Users'), 'page' => 'users.php', 'parent' => array('users'));
}
if (isAuthorized('viewUsersGroups')) {
    $menu['users_groups'] = array('id' => 'users_groups', 'name' => _('User Groups'), 'page' => 'usersgroup.php', 'parent' => array('users'));
}
if (isAuthorized('viewApplications')) {
    $menu['applications_child'] = array('id' => 'applications_child', 'name' => _('Applications'), 'page' => 'applications.php', 'parent' => array('applications'));
    $menu['applications_webapp'] = array('id' => 'applications_webapp', 'name' => _('Web Applications'), 'page' => 'applications_webapp.php', 'parent' => array('applications'));
}
if (isAuthorized('viewApplicationsGroups')) {
    $menu['applications_groups'] = array('id' => 'applications_groups', 'name' => _('Application Groups'), 'page' => 'appsgroup.php', 'parent' => array('applications'));
開發者ID:bloveing,項目名稱:openulteo,代碼行數:31,代碼來源:page_template.php

示例13: show_manage


//.........這裏部分代碼省略.........
        echo '<td>' . $key . ' ' . $buffer . '</td>';
        if ($can_manage_usersgroups && !$extends_from_default) {
            echo '<td>';
            echo '<form action="actions.php" method="post" onsubmit="return confirm(\'' . _('Are you sure you want to delete this rule?') . '\');">';
            echo '<input type="hidden" name="name" value="UserGroup_PolicyRule" />';
            echo '<input type="hidden" name="action" value="del" />';
            echo '<input type="hidden" name="id" value="' . $group->id . '" />';
            echo '<input type="hidden" name="element" value="' . $key . '" />';
            echo '<input type="submit" value="' . _('Delete this rule') . '" />';
            echo '</form>';
            echo '</td>';
        }
        echo '</tr>';
    }
    if ($can_manage_usersgroups && count($policy_rules_disable) > 0 && array_search(false, $policy) !== false) {
        echo '<tr><form action="actions.php" method="post"><td>';
        echo '<input type="hidden" name="name" value="UserGroup_PolicyRule" />';
        echo '<input type="hidden" name="action" value="add" />';
        echo '<input type="hidden" name="id" value="' . $group->id . '" />';
        echo '<select name="element">';
        foreach ($policy as $key => $value) {
            if ($value === true) {
                continue;
            }
            echo '<option value="' . $key . '" >' . $key . '</option>';
        }
        echo '</select>';
        echo '</td><td><input type="submit" value="' . _('Add this rule') . '" /></td>';
        echo '</form></tr>';
    }
    echo '</table>';
    echo '</div>';
    echo '<br/>';
    if (is_module_enabled('SharedFolderDB')) {
        $all_sharedfolders = $_SESSION['service']->shared_folders_list();
        if (is_null($all_sharedfolders)) {
            $all_sharedfolders = array();
        }
        if (count($all_sharedfolders) > 0) {
            $available_sharedfolders = array();
            $used_sharedfolders = array();
            if ($group->hasAttribute('shared_folders')) {
                $data = $group->getAttribute('shared_folders');
                $mods_by_share = array();
                foreach ($data as $mode => $used_sharedfolders2) {
                    foreach ($used_sharedfolders2 as $share_id => $share_name) {
                        $used_sharedfolders[$share_id] = $share_name;
                        $mods_by_share[$share_id] = $mode;
                    }
                }
            }
            foreach ($all_sharedfolders as $sharedfolder) {
                if (array_key_exists($sharedfolder->id, $used_sharedfolders)) {
                    continue;
                }
                $available_sharedfolders[] = $sharedfolder;
            }
            echo '<br />';
            echo '<div>';
            echo '<h2>' . _('Shared Folders') . '</h1>';
            echo '<table border="0" cellspacing="1" cellpadding="3">';
            foreach ($used_sharedfolders as $sharedfolder_id => $sharedfolder_name) {
                echo '<tr>';
                echo '<td><a href="sharedfolders.php?action=manage&amp;id=' . $sharedfolder_id . '">' . $sharedfolder_name . '</a></td>';
                echo '<td>' . $mods_by_share[$sharedfolder_id] . '</td>';
                if ($can_manage_sharedfolders) {
開發者ID:bloveing,項目名稱:openulteo,代碼行數:67,代碼來源:usersgroup.php

示例14: updateAndSyncRoles

 /**
  * @param $userId
  * @param $data
  * @param $roles
  * @internal param $user
  * @return mixed
  */
 public function updateAndSyncRoles($userId, $data, $roles)
 {
     $user = $this->user->find($userId);
     $this->checkForNewPassword($data);
     $this->checkForManualActivation($user, $data);
     $user = $user->fill($data);
     $user->save();
     if (is_module_enabled('Site')) {
         $user->syncSites($data);
     }
     event(new UserWasUpdated($user));
     if (!empty($roles)) {
         $user->roles()->sync($roles);
     }
 }
開發者ID:bitsoflove,項目名稱:User,代碼行數:22,代碼來源:SentinelUserRepository.php

示例15: is_mib_poller_enabled

function is_mib_poller_enabled($device)
{
    if (!is_module_enabled('poller', 'mib')) {
        return false;
    }
    if (!is_dev_attrib_enabled($device, 'poll_mib')) {
        d_echo('MIB module disabled for ' . $device['hostname'] . "\n");
        return false;
    }
    return true;
}
開發者ID:BillTheBest,項目名稱:librenms,代碼行數:11,代碼來源:common.php


注:本文中的is_module_enabled函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。