<?php
/**
* @file includes/modules.php
* @description Module model for checking, deleting, installing modules.
* @package Open-School v1.0
* @copyright Copyright (C) 2005 - 2008 Open-School. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Open-School is free software. This version may have been modified
pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
//Shows a Module
function show_module($params)
{
if(is_module($params['module']))
{
$view = $params['view'];
$action = $params['action'];
$id = $params['id'];
include(MODULES_PATH.$params['module'].'/controller.php');
}else{
return false;
}
}
//Check Module.
function is_module($module_name)
{
$connection = db_connect();
$query = sprintf("SELECT * FROM modules WHERE name = '%s'",
mysql_real_escape_string($module_name));
$result = mysql_query($query);
//Checking Whether the Result is Empty.
$number_of_news = mysql_num_rows($result);
if ($number_of_news == 0)
{
return false;
}
return true;
}
//Returns the array of modules.
function list_modules()
{
$connection = db_connect();
$query = 'SELECT * FROM modules WHERE system = 0';
$result = mysql_query($query);
//Checking Whether the Result is Empty.
$number_of_news = mysql_num_rows($result);
if ($number_of_news == 0)
{
return false;
}
$result = result_to_array($result);
return $result;
}
function list_modules_menu()
{
$connection = db_connect();
$query = 'SELECT * FROM modules WHERE show_menu = 1';
$result = mysql_query($query);
//Checking Whether the Result is Empty.
$number_of_news = mysql_num_rows($result);
if ($number_of_news == 0)
{
return false;
}
$result = result_to_array($result);
return $result;
}
//Load template.
function load_template($module,$view)
{
if (file_exists(TEMPLATE_PATH.'modules/'.$module.'/'.$view.'.php'))
{ include_once(TEMPLATE_PATH.'modules/'.$module.'/'.$view.'.php');}
elseif (file_exists(TEMPLATE_PATH.'modules/'.$module.'/index.php'))
{ include_once(TEMPLATE_PATH.'modules/'.$module.'/index.php');}
elseif (file_exists(TEMPLATE_PATH.'index.php'))
{ include_once(TEMPLATE_PATH.'index.php');}
elseif
(file_exists(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.$view.'.php'))
{
include_once(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.$view.'.php');}
elseif
(file_exists(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.'index.php'))
{
include_once(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.'index.php');}
elseif (file_exists(SERVER_ROOT.APP_ROOT.'/templates/oslite/index.php'))
{ include_once(SERVER_ROOT.APP_ROOT.'/templates/oslite/index.php');}
else
{ include_once(ERROR_PAGE);}
}
?>
On Mon, May 14, 2012 at 4:11 PM, vikram sharma <[email protected]>wrote:
> Hi its a cake php based.
>
>
> On Mon, May 14, 2012 at 4:04 PM, AD7six <[email protected]> wrote:
>
>>
>>
>> On Monday, 14 May 2012 12:20:20 UTC+2, vikram sharma wrote:
>>>
>>> *HELLO ,
>>>
>>> i INSTALL THE SOFTWARE
>>> http://open-school.org/<http://open-school.org/>FOR SCHOOL MANAGMENT
>>> SOFTWARE THERE COME AN ISSUE
>>>
>>> Warning: include_once() [function.include]: Failed opening 'ERROR_PAGE'
>>> for inclusion (include_path='.:/opt/lampp/lib/php') in
>>> ........../includes/modules.php on line 87
>>>
>>> ANY BODY CAN HELP ME? HOW I RESOLVE THE ISSUE .
>>>
>>> *
>>
>>
>> Whatever that is - it's not CakePHP based so I would suggest asking in an
>> appropriate place (their forum, a php forum, street corners)
>>
>> AD
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> [email protected] For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>
>
> --
>
> *
> Thanks & Regards**
> **Vikram Sharma | Cell +9466205050 |*
> *E-Mail : [email protected] <[email protected]> | *
> *>>> My Quotes <https://sites.google.com/site/vikramquotes/>*
> *
>
> <https://sites.google.com/a/daffodildb.com/rwpersonal/>
> **
> **
>
> <http://goog_605103996>
>
>
> *
>
>
--
*
Thanks & Regards**
**Vikram Sharma | Cell +9466205050 |*
*E-Mail : [email protected] <[email protected]> | * *>>>
My Quotes <https://sites.google.com/site/vikramquotes/>*
*
<https://sites.google.com/a/daffodildb.com/rwpersonal/>
**
**
<http://goog_605103996>
*
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php