Ip\Internal\Plugins\Model::getActivePluginNames PHP Method

getActivePluginNames() public static method

public static getActivePluginNames ( )
    public static function getActivePluginNames()
    {
        if (\Ip\Internal\Admin\Service::isSafeMode()) {
            return array();
        }
        $dbh = ipDb()->getConnection();
        $sql = '
            SELECT
                `name`
            FROM
                ' . ipTable('plugin') . '
            WHERE
                `isActive` = 1
        ';
        $params = array();
        $q = $dbh->prepare($sql);
        $q->execute($params);
        $data = $q->fetchAll(\PDO::FETCH_COLUMN);
        //fetch all rows as an array
        return $data;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Get list of all available permissions on the system
  */
 public static function availablePermissions()
 {
     $permissions = array('Super admin', 'Content', 'Pages', 'Design', 'Plugins', 'Config', 'Config advanced', 'Languages', 'System', 'Administrators', 'Log', 'Email', 'Repository', 'Repository upload');
     $plugins = \Ip\Internal\Plugins\Model::getActivePluginNames();
     foreach ($plugins as $plugin) {
         if (is_file(ipFile('Plugin/' . $plugin . '/AdminController.php'))) {
             array_push($permissions, $plugin);
         }
     }
     $permissions = ipFilter('ipAvailablePermissions', $permissions);
     return $permissions;
 }
All Usage Examples Of Ip\Internal\Plugins\Model::getActivePluginNames