Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
import_tool_converter.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/asset.inc';
18 
31 {
32 
33 
40  function Import_Tool_Converter($assetid=0)
41  {
42  $this->_ser_attrs = TRUE;
43  $this->Asset($assetid);
44 
45  }//end constructor
46 
47 
58  function _preCreateCheck(&$link)
59  {
60  if (!parent::_preCreateCheck($link)) return FALSE;
61 
62  $name = trim($this->attr('name'));
63  if ($name == '') {
64  trigger_localised_error('CORE0083', E_USER_WARNING, $GLOBALS['SQ_SYSTEM']->am->getTypeInfo($this->type(), 'name'));
65  return FALSE;
66  }
67 
68  return TRUE;
69 
70  }//end _preCreateCheck()
71 
72 
83  function _createAdditional(&$link)
84  {
85  if (!parent::_createAdditional($link)) return FALSE;
86 
87  // set a web path if we are linking this folder somewhere
88  // NOTE: the main time we wont want to do this is if we are creating
89  // the root folder as it is not linked anywhere
90  if (!empty($link)) {
91  // set an initial web path
92  $initial_path = strtolower($this->attr('name'));
93  require_once SQ_INCLUDE_PATH.'/general_occasional.inc';
94  $valid_paths = make_valid_web_paths(Array($initial_path));
95  $good_paths = $GLOBALS['SQ_SYSTEM']->am->webPathsInUse($link['asset'], $valid_paths, $this->id, TRUE);
96  if (!$this->saveWebPaths($good_paths)) return FALSE;
97  }
98  return TRUE;
99 
100  }//end _createAdditional()
101 
102 
112  function _getName($short_name=FALSE)
113  {
114  return $this->attr('name');
115 
116  }//end _getName()
117 
118 
128  function setAttrValue($name, $value)
129  {
130  if ($name == 'name') {
131  trigger_localised_error('CORE0111', E_USER_WARNING, $GLOBALS['SQ_SYSTEM']->am->getTypeInfo($this->type(), 'name'));
132  return FALSE;
133  }
134 
135  return parent::setAttrValue($name, $value);
136 
137  }//end setAttrValue()
138 
139 
147  function _getAllowedLinks()
148  {
149 
150  return Array(
151  SQ_LINK_TYPE_1 => Array(
152  'file' => Array(
153  'card' => 'M',
154  'exclusive' => FALSE,
155  ),
156  ),
157  SQ_LINK_TYPE_2 => Array(
158  'file' => Array(
159  'card' => 'M',
160  'exclusive' => FALSE,
161  ),
162  ),
163  );
164 
165  }//end _getAllowedLinks()
166 
167 
168 }//end class
169 ?>