• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Modules/WebResource/classes/class.ilObjLinkResource.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2005 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 include_once "./classes/class.ilObject.php";
00025 
00037 class ilObjLinkResource extends ilObject
00038 {
00045         function ilObjLinkResource($a_id = 0,$a_call_by_reference = true)
00046         {
00047                 //$this->type = "lnkr";
00048                 $this->type = "webr";
00049                 $this->ilObject($a_id,$a_call_by_reference);
00050         }
00051 
00057         function create($a_upload = false)
00058         {
00059                 $new_id = parent::create();
00060                 
00061                 if(!$a_upload)
00062                 {
00063                         $this->createMetaData();
00064                 }
00065                 
00066                 return $new_id;
00067         }
00068 
00072         function update()
00073         {
00074                 $this->updateMetaData();
00075                 parent::update();
00076         }
00077 
00078 
00085         function delete()
00086         {
00087                 // always call parent delete function first!!
00088                 if (!parent::delete())
00089                 {
00090                         return false;
00091                 }
00092 
00093                 // delete items
00094                 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
00095                 ilLinkResourceItems::_deleteAll($this->getId());
00096 
00097 
00098                 // Delete notify entries
00099                 include_once './classes/class.ilLinkCheckNotify.php';
00100                 ilLinkCheckNotify::_deleteObject($this->getId());
00101 
00102                 // delete meta data
00103                 $this->deleteMetaData();
00104 
00105                 return true;
00106         }
00107 
00108         function initLinkResourceItemsObject()
00109         {
00110                 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
00111 
00112                 $this->items_obj =& new ilLinkResourceItems($this->getId());
00113 
00114                 return true;
00115         }
00116         
00125         public function cloneObject($a_target_id,$a_copy_id = 0)
00126         {
00127                 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
00128                 $this->cloneMetaData($new_obj);
00129                 
00130                 // object created now copy other settings
00131                 include_once('Modules/WebResource/classes/class.ilLinkResourceItems.php');
00132                 $links = new ilLinkResourceItems($this->getId());
00133                 $links->cloneItems($new_obj->getId());
00134                 
00135                 return $new_obj;
00136         }
00137 
00138         // PRIVATE
00139 
00140 
00141 } // END class.ilObjLinkResource
00142 ?>

Generated on Fri Dec 13 2013 17:56:54 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1