[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] api/class.datamine.php, 1.1.2.1
From: |
nomail |
Subject: |
[Phpgroupware-cvs] api/class.datamine.php, 1.1.2.1 |
Date: |
Thu, 20 May 2004 14:04:23 -0000 |
Update of /api
Added Files:
Branch: proposal-branch
class.datamine.php
date: 2004/04/16 20:59:48; author: seek3r; state: Exp; lines: +102 -0
Log Message:
bringing savannah cvs back up to date with what we were doing on our private
cvs server. We will not be doing dev from this cvs tree
=====================================================================
No syntax errors detected in -
=====================================================================
<?php
/**************************************************************************\
* phpGroupWare
*
* http://www.phpgroupware.org
*
* This file written by Joseph Engo <address@hidden> *
* Copyright (C) 2004 Joseph Engo
*
*
-------------------------------------------------------------------------*
* This library is part of the phpGroupWare API
*
* http://www.phpgroupware.org/api
*
*
------------------------------------------------------------------------ *
* This library is free software; you can redistribute it and/or modify
it *
* under the terms of the GNU Lesser General Public License as published
by *
* the Free Software Foundation; either version 2.1 of the License,
*
* or any later version.
*
* This library is distributed in the hope that it will be useful, but
*
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
License *
* along with this library; if not, write to the Free Software
Foundation, *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\**************************************************************************/
/* $Id: class.datamine.php,v 1.1.2.1 2004/04/16 20:59:48 seek3r Exp $ */
/* $Source: /cvsroot/phpgroupware/api/Attic/class.datamine.php,v $ */
$GLOBALS['datamine_menus_loaded'] = false;
class api_datamine
{
function api_datamine()
{
//
}
function __create_menu($location)
{
if (! $GLOBALS['datamine_menus_loaded'])
{
$dbresult =
$GLOBALS['phpgw']->db->execute("SELECT dml_title,dml_op FROM "
. "phpgw_datamine_locations ORDER BY
dml_title");
while (! $dbresult->EOF)
{
$GLOBALS['phpgw']->add_appmenu('Datamine
menu',$dbresult->fields['dml_title'],$dbresult->fields['dml_op'] .
'&dm_type=D&datamine_location=' . $location . '&dm_redirect=' .
$_SESSION['phpgw_session']['phpgw_data']['current_history_position']);
$dbresult->movenext();
}
$GLOBALS['datamine_menus_loaded'] = true;
$GLOBALS['phpgw']->add_appmenu('Datamine
menu','Show map',' ');
}
}
function _get()
{
$args = new safe_args();
$args->set('location',REQUIRED,'any');
$args = $args->get(func_get_args());
$this->__create_menu($args['location']);
$dbresult = $GLOBALS['phpgw']->db->execute("SELECT *
from phpgw_datamine WHERE "
. "dm_location_from='" . $args['location'] . "'
and dm_owner="
. $GLOBALS['phpgw_data']['user']['id']);
if ($dbresult->EOF)
{
return array();
}
else
{
while (! $dbresult->EOF)
{
// The no_app_menu is *ONLY* a temp
workaround for not showing the app menu
// durring _datamine_get(), I am
currently working on another solution to it
$GLOBALS['no_app_menu'] = true;
list($app,$class,$id) =
explode('.',$dbresult->fields['dm_location_to']);
$result[] = array
(
'type' => $app . '_' . $class,
'data' => execMethod($app . '.'
. $class . '._datamine_get',$id)
);
$dbresult->movenext();
}
}
return $result;
}
function _set()
{
$args = new safe_args();
$args->set('location_from',REQUIRED,'any');
$args->set('location_to',REQUIRED,'any');
$args = $args->get(func_get_args());
$GLOBALS['phpgw']->db->execute("INSERT into
phpgw_datamine (dm_owner,dm_location_from,"
. "dm_location_to) VALUES (" .
$GLOBALS['phpgw_data']['user']['id'] . ",'"
. $args['location_from'] . "','" .
$args['location_to'] . "')");
return true;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] api/class.datamine.php, 1.1.2.1,
nomail <=