ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjLinkResource.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2005 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once "./classes/class.ilObject.php";
25 
38 {
45  function ilObjLinkResource($a_id = 0,$a_call_by_reference = true)
46  {
47  //$this->type = "lnkr";
48  $this->type = "webr";
49  $this->ilObject($a_id,$a_call_by_reference);
50  }
51 
57  function create($a_upload = false)
58  {
59  $new_id = parent::create();
60 
61  if(!$a_upload)
62  {
63  $this->createMetaData();
64  }
65 
66  return $new_id;
67  }
68 
72  function update()
73  {
74  $this->updateMetaData();
76  }
77 
78 
85  function delete()
86  {
87  // always call parent delete function first!!
88  if (!parent::delete())
89  {
90  return false;
91  }
92 
93  // delete items
94  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
96 
97 
98  // Delete notify entries
99  include_once './classes/class.ilLinkCheckNotify.php';
101 
102  // delete meta data
103  $this->deleteMetaData();
104 
105  return true;
106  }
107 
109  {
110  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
111 
112  $this->items_obj =& new ilLinkResourceItems($this->getId());
113 
114  return true;
115  }
116 
125  public function cloneObject($a_target_id,$a_copy_id = 0)
126  {
127  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
128  $this->cloneMetaData($new_obj);
129 
130  // object created now copy other settings
131  include_once('Modules/WebResource/classes/class.ilLinkResourceItems.php');
132  $links = new ilLinkResourceItems($this->getId());
133  $links->cloneItems($new_obj->getId());
134 
135  return $new_obj;
136  }
137 
138  // PRIVATE
139 
140 
141 } // END class.ilObjLinkResource
142 ?>