Cheetah
ChWsbInstallerUi.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbDb');
9 ch_import('ChWsbModuleDb');
10 ch_import('ChTemplSearchResult');
11 
13 {
16  var $_aTypesConfig = array (
17  'module' => array (
18  'configfile' => '/install/config.php',
19  'configvar' => 'aConfig',
20  'configvarindex' => 'home_dir',
21  'folder' => 'modules/',
22  'subfolder' => '{configvar}',
23  ),
24  'update' => array (
25  'configfile' => '/install/config.php',
26  'configvar' => 'aConfig',
27  'configvarindex' => 'home_dir',
28  'folder' => 'modules/',
29  'subfolder' => '{configvar}',
30  ),
31  'template' => array (
32  'configfile' => '/scripts/ChTemplName.php',
33  'configvar' => 'sTemplName',
34  'folder' => 'templates/',
35  'subfolder' => '{packagerootfolder}',
36  ),
37  );
38 
39  function __construct()
40  {
41  parent::__construct();
42 
43  $this->_sDefVersion = '0.0.0';
44  $this->_aCheckPathes = array();
45  }
46  function getUploader($sResult, $sPackageTitleKey = '_adm_txt_modules_module', $bUnsetUpdate = false, $sAction = false)
47  {
48  $aForm = array(
49  'form_attrs' => array(
50  'id' => 'module_upload_form',
51  'action' => $sAction ? $sAction : ch_html_attribute($_SERVER['PHP_SELF']),
52  'method' => 'post',
53  'enctype' => 'multipart/form-data',
54  ),
55  'inputs' => array (
56  'header1' => array(
57  'type' => 'block_header',
58  'caption' => _t('_adm_txt_modules_package_to_upload'),
59  ),
60  'module' => array(
61  'type' => 'file',
62  'name' => 'module',
63  'caption' => _t($sPackageTitleKey),
64  ),
65  'update' => array(
66  'type' => 'file',
67  'name' => 'update',
68  //'caption' => _t('_adm_btn_modules_update'), // Deano - Temporarily disable until update system can be changed for Cheetahs use.
69  'caption' => '',
70  ),
71  'header2' => array(
72  'type' => 'block_header',
73  'caption' => _t('_adm_txt_modules_ftp_access'),
74  ),
75  'host' => array(
76  'type' => 'text',
77  'name' => 'host',
78  'caption' => _t('_adm_txt_modules_host'),
79  'value' => getParam('sys_ftp_login')
80  ),
81  'login' => array(
82  'type' => 'text',
83  'name' => 'login',
84  'caption' => _t('_adm_txt_modules_login'),
85  'value' => getParam('sys_ftp_login')
86  ),
87  'password' => array(
88  'type' => 'password',
89  'name' => 'password',
90  'caption' => _t('_Password'),
91  'value' => getParam('sys_ftp_password')
92  ),
93  'path' => array(
94  'type' => 'text',
95  'name' => 'path',
96  'caption' => _t('_adm_txt_modules_path_to_cheetah'),
97  'value' => !($sPath = getParam('sys_ftp_dir')) ? 'public_html/' : $sPath
98  ),
99  'submit_upload' => array(
100  'type' => 'submit',
101  'name' => 'submit_upload',
102  'value' => _t('_adm_box_cpt_upload'),
103  )
104  )
105  );
106 
107  if ($bUnsetUpdate)
108  unset($aForm['inputs']['update']);
109 
111  $sContent = $oForm->getCode();
112 
113  if(!empty($sResult))
115 
116  return $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_uploader.html', array(
117  'content' => $sContent
118  ));
119  }
120  function getInstalled()
121  {
122  //--- Get Items ---//
123  $oModules = new ChWsbModuleDb();
124  $aModules = $oModules->getModules();
125 
126  $aItems = array();
127  foreach($aModules as $aModule) {
128  if(strpos($aModule['dependencies'], $aModule['uri']) !== false)
129  continue;
130 
131  $sUpdate = '';
132  if(in_array($aModule['path'], $this->_aCheckPathes)) {
134  $sUpdate = $this->_parseUpdate($aCheckInfo);
135  }
136 
137  $aItems[] = array(
138  'name' => $aModule['uri'],
139  'value' => $aModule['path'],
140  'title'=> _t('_adm_txt_modules_title_module', $aModule['title'], !empty($aModule['version']) ? $aModule['version'] : $this->_sDefVersion, $aModule['vendor']),
141  'can_update' => isset($aModule['update_url']) && !empty($aModule['update_url']) ? 1 : 0,
142  'update' => $sUpdate,
143  );
144  }
145 
146  //--- Get Controls ---//
147  $aButtons = array(
148  'modules-uninstall' => array('type' => 'submit', 'name' => 'modules-uninstall', 'value' => _t('_adm_btn_modules_uninstall'), 'onclick' => 'onclick="javascript: return ' . CH_WSB_ADM_MM_JS_NAME . '.onSubmitUninstall(this);"'),
149  'modules-recompile-languages' => _t('_adm_btn_modules_recompile_languages')
150  );
151 
152  $oZ = new ChWsbAlerts('system', 'admin_modules_buttons', 0, 0, array(
153  'place' => 'installed',
154  'buttons' => &$aButtons,
155  ));
156  $oZ->alert();
157 
158  $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array(
159  'type' => 'installed',
160  'ch_repeat:items' => !empty($aItems) ? $aItems : MsgBox(_t('_Empty')),
161  'controls' => ChTemplSearchResult::showAdminActionsPanel('modules-installed-form', $aButtons, 'pathes')
162  ));
163 
164  // Deano - Temporarily disable until update system can be changed for Cheetahs use.
165  //$aTopMenu = array(
166  // 'modules-update' => array('title' => '_adm_btn_modules_update', 'href' => 'javascript:void(0)', 'onclick' => 'javascript:' . CH_WSB_ADM_MM_JS_NAME . '.checkForUpdates(this);')
167  //);
168  $aTopMenu = array(
169  );
170 
171  $GLOBALS['oAdmTemplate']->addJsTranslation(array('_adm_txt_modules_data_will_be_lost'));
172  return DesignBoxAdmin(_t('_adm_box_cpt_installed_modules'), $sContent, $aTopMenu);
173  }
175  {
176  //--- Get Items ---//
177  $oModules = new ChWsbModuleDb();
178  $aModules = $oModules->getModules();
179 
180  $aInstalled = array();
181  foreach($aModules as $aModule)
182  $aInstalled[] = $aModule['path'];
183 
184  $aNotInstalled = array();
185  $sPath = CH_DIRECTORY_PATH_ROOT . 'modules/';
186  if($rHandleVendor = opendir($sPath)) {
187 
188  while(($sVendor = readdir($rHandleVendor)) !== false) {
189  if(substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor)) continue;
190 
191  if($rHandleModule = opendir($sPath . $sVendor)) {
192  while(($sModule = readdir($rHandleModule)) !== false) {
193  if(!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.' || in_array($sVendor . '/' . $sModule . '/', $aInstalled))
194  continue;
195 
196  $sConfigPath = $sPath . $sVendor . '/' . $sModule . '/install/config.php';
197  if(!file_exists($sConfigPath)) continue;
198 
199  include($sConfigPath);
200  $aNotInstalled[$aConfig['title']] = array(
201  'name' => $aConfig['home_uri'],
202  'value' => $aConfig['home_dir'],
203  'title' => _t('_adm_txt_modules_title_module', $aConfig['title'], !empty($aConfig['version']) ? $aConfig['version'] : $this->_sDefVersion, $aConfig['vendor']),
204  'can_update' => '0',
205  'update' => ''
206  );
207  }
208  closedir($rHandleModule);
209  }
210  }
211  closedir($rHandleVendor);
212  }
213  ksort($aNotInstalled);
214 
215  //--- Get Controls ---//
216  $aButtons = array(
217  'modules-install' => _t('_adm_btn_modules_install'),
218  'modules-delete' => _t('_adm_btn_modules_delete')
219  );
220 
221  $oZ = new ChWsbAlerts('system', 'admin_modules_buttons', 0, 0, array(
222  'place' => 'uninstalled',
223  'buttons' => &$aButtons,
224  ));
225  $oZ->alert();
226 
227  $sControls = ChTemplSearchResult::showAdminActionsPanel('modules-not-installed-form', $aButtons, 'pathes');
228 
229  if(!empty($sResult))
230  $sResult = MsgBox(_t($sResult), 10);
231 
232  return $sResult . $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array(
233  'type' => 'not-installed',
234  'ch_repeat:items' => !empty($aNotInstalled) ? array_values($aNotInstalled) : MsgBox(_t('_Empty')),
235  'controls' => $sControls
236  ));
237  }
239  {
240  $aUpdates = array();
241  $sPath = CH_DIRECTORY_PATH_ROOT . 'modules/';
242  if($rHandleVendor = opendir($sPath)) {
243  while(($sVendor = readdir($rHandleVendor)) !== false) {
244  if(substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor))
245  continue;
246 
247  if($rHandleModule = opendir($sPath . $sVendor . '/')) {
248  while(($sModule = readdir($rHandleModule)) !== false) {
249  if(!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.')
250  continue;
251 
252  if($rHandleUpdate = @opendir($sPath . $sVendor . '/' . $sModule . '/updates/')) {
253  while(($sUpdate = readdir($rHandleUpdate)) !== false) {
254  if(!is_dir($sPath . $sVendor . '/' . $sModule . '/updates/' . $sUpdate) || substr($sUpdate, 0, 1) == '.')
255  continue;
256 
257  $sConfigPath = $sPath . $sVendor . '/' . $sModule . '/updates/' . $sUpdate . '/install/config.php';
258  if(!file_exists($sConfigPath))
259  continue;
260 
261  include($sConfigPath);
262  $sName = $aConfig['title'] . $aConfig['module_uri'] . $aConfig['version_from'] . $aConfig['version_to'];
263  $aUpdates[$sName] = array(
264  'name' => md5($sName),
265  'value' => $aConfig['home_dir'],
266  'title' => _t('_adm_txt_modules_title_update', $aConfig['title'], $aConfig['version_from'], $aConfig['version_to']),
267  'can_update' => '0',
268  'update' => ''
269  );
270  }
271  closedir($rHandleUpdate);
272  }
273  }
274  closedir($rHandleModule);
275  }
276  }
277  closedir($rHandleVendor);
278  }
279  ksort($aUpdates);
280 
281  //--- Get Controls ---//
282  $aButtons = array(
283  'updates-install' => _t('_adm_btn_modules_install'),
284  'updates-delete' => _t('_adm_btn_modules_delete')
285  );
286  $sControls = ChTemplSearchResult::showAdminActionsPanel('modules-updates-form', $aButtons, 'pathes');
287 
288  if(!empty($sResult))
289  $sResult = MsgBox(_t($sResult), 10);
290 
291  return $sResult . $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array(
292  'type' => 'updates',
293  'ch_repeat:items' => !empty($aUpdates) ? array_values($aUpdates) : MsgBox(_t('_Empty')),
294  'controls' => $sControls
295  ));
296  }
297 
298  //--- Get/Set methods ---//
299  function setCheckPathes($aPathes)
300  {
301  $this->_aCheckPathes = is_array($aPathes) ? $aPathes : array();
302  }
303 
304  //--- Actions ---//
305  function actionUpload($sType, $aFile, $aFtpInfo)
306  {
307  $sHost = htmlspecialchars_adv(clear_xss($aFtpInfo['host']));
308  $sLogin = htmlspecialchars_adv(clear_xss($aFtpInfo['login']));
309  $sPassword = htmlspecialchars_adv(clear_xss($aFtpInfo['password']));
310  $sPath = htmlspecialchars_adv(clear_xss($aFtpInfo['path']));
311 
312  setParam('sys_ftp_host', $sHost);
313  setParam('sys_ftp_login', $sLogin);
314  setParam('sys_ftp_password', $sPassword);
315  setParam('sys_ftp_dir', $sPath);
316 
317  $sErrMsg = false;
318 
319  $sName = time();
320  $sAbsolutePath = CH_DIRECTORY_PATH_ROOT . "tmp/" . $sName . '.zip';
321  $sPackageRootFolder = false;
322 
323  if (!class_exists('ZipArchive'))
324  $sErrMsg = '_adm_txt_modules_zip_not_available';
325 
326  if (!$sErrMsg && $this->_isArchive($aFile['type']) && move_uploaded_file($aFile['tmp_name'], $sAbsolutePath)) {
327 
328  // extract uploaded zip package into tmp folder
329 
330  $oZip = new ZipArchive();
331  if ($oZip->open($sAbsolutePath) !== TRUE)
332  $sErrMsg = '_adm_txt_modules_cannot_unzip_package';
333 
334  if (!$sErrMsg) {
335  $sPackageRootFolder = $oZip->numFiles > 0 ? $oZip->getNameIndex(0) : false;
336 
337  if (file_exists(CH_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder)) // remove existing tmp folder with the same name
338  ch_rrmdir(CH_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder);
339 
340  if ($sPackageRootFolder && !$oZip->extractTo(CH_DIRECTORY_PATH_ROOT . 'tmp/'))
341  $sErrMsg = '_adm_txt_modules_cannot_unzip_package';
342 
343  $oZip->close();
344  }
345 
346  // upload files to the correct folder via FTP
347 
348  if (!$sErrMsg && $sPackageRootFolder) {
349 
350  $oFtp = new ChWsbFtp(!empty($sHost) ? $sHost : $_SERVER['HTTP_HOST'], $sLogin, $sPassword, $sPath);
351 
352  if (!$oFtp->connect())
353  $sErrMsg = '_adm_txt_modules_cannot_connect_to_ftp';
354 
355  if (!$sErrMsg && !$oFtp->isCheetah())
356  $sErrMsg = '_adm_txt_modules_destination_not_valid';
357 
358  if (!$sErrMsg) {
359  $sConfigPath = CH_DIRECTORY_PATH_ROOT . "tmp/" . $sPackageRootFolder . $this->_aTypesConfig[$sType]['configfile'];
360  if (file_exists($sConfigPath)) {
361  include($sConfigPath);
362  $sConfigVar = !empty($this->_aTypesConfig[$sType]['configvarindex']) ? ${$this->_aTypesConfig[$sType]['configvar']}[$this->_aTypesConfig[$sType]['configvarindex']] : ${$this->_aTypesConfig[$sType]['configvar']};
363  $sSubfolder = $this->_aTypesConfig[$sType]['subfolder'];
364  $sSubfolder = str_replace('{configvar}', $sConfigVar, $sSubfolder);
365  $sSubfolder = str_replace('{packagerootfolder}', $sPackageRootFolder, $sSubfolder);
366  if (!$oFtp->copy(CH_DIRECTORY_PATH_ROOT . "tmp/" . $sPackageRootFolder . '/', $this->_aTypesConfig[$sType]['folder'] . $sSubfolder))
367  $sErrMsg = '_adm_txt_modules_ftp_copy_failed';
368  } else {
369  $sErrMsg = '_adm_txt_modules_wrong_package_format';
370  }
371  }
372 
373  } else {
374  $sErrMsg = '_adm_txt_modules_cannot_unzip_package';
375  }
376 
377  // remove temporary files
378  ch_rrmdir(CH_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder);
379  unlink($sAbsolutePath);
380 
381  } else {
382  $sErrMsg = '_adm_txt_modules_cannot_upload_package';
383  }
384 
385  return $sErrMsg ? $sErrMsg : '_adm_txt_modules_success_upload';
386  }
387  function actionInstall($aDirectories)
388  {
389  return $this->_perform($aDirectories, 'install');
390  }
391  function actionUninstall($aDirectories)
392  {
393  return $this->_perform($aDirectories, 'uninstall');
394  }
395  function actionRecompile($aDirectories)
396  {
397  return $this->_perform($aDirectories, 'recompile');
398  }
399  function actionUpdate($aDirectories)
400  {
401  return $this->_perform($aDirectories, 'update');
402  }
403  function actionDelete($aDirectories, $sType = 'module')
404  {
405  $sFtpHost = getParam('sys_ftp_host');
406  if(empty($sFtpHost))
407  $sFtpHost = $_SERVER['HTTP_HOST'];
408 
409  $oFtp = new ChWsbFtp($sFtpHost, getParam('sys_ftp_login'), getParam('sys_ftp_password'), getParam('sys_ftp_dir'));
410  if (!$oFtp->connect())
411  return '_adm_txt_modules_cannot_connect_to_ftp';
412 
413  $sDir = $this->_aTypesConfig[$sType]['folder'];
414  foreach ($aDirectories as $sDirectory)
415  if (!$oFtp->delete($sDir . $sDirectory))
416  return '_adm_txt_modules_cannot_remove_package';
417 
418  return '_adm_txt_modules_success_delete';
419  }
420  function checkForUpdatesByPath($sPath)
421  {
422  ch_import('ChWsbModuleDb');
423  $oModuleDb = new ChWsbModuleDb();
424  $aModule = $oModuleDb->getModulesBy(array('type' => 'path', 'value' => $sPath));
425 
427  $aResult['content'] = $this->_parseUpdate($aResult);
428  return $aResult;
429  }
430  function downloadUpdate($sLink)
431  {
432  $sName = time() . '.zip';
433  $sData = ch_file_get_contents($sLink);
434 
435  //--- write ZIP archive.
436  $sTmpPath = CH_DIRECTORY_PATH_ROOT . 'tmp/';
437  $sFilePath = $sTmpPath . $sName;
438  if (!$rHandler = fopen($sFilePath, 'w'))
439  return _t('_adm_txt_modules_cannot_download_package');
440 
441  if (!fwrite($rHandler, $sData))
442  return _t('_adm_txt_modules_cannot_write_package');
443 
444  fclose($rHandler);
445 
446  //--- Unarchive package.
447  if(!class_exists('ZipArchive'))
448  return _t('_adm_txt_modules_zip_not_available');
449 
450  $oZip = new ZipArchive();
451  if($oZip->open($sFilePath) !== true)
452  return _t('_adm_txt_modules_cannot_unzip_package');
453 
454  $sPackageRootFolder = $oZip->numFiles > 0 ? $oZip->getNameIndex(0) : false;
455  if($sPackageRootFolder && file_exists($sTmpPath . $sPackageRootFolder)) // remove existing tmp folder with the same name
456  ch_rrmdir($sTmpPath . $sPackageRootFolder);
457 
458  if($sPackageRootFolder && !$oZip->extractTo($sTmpPath))
459  return _t('_adm_txt_modules_cannot_unzip_package');
460 
461  $oZip->close();
462 
463  //--- Move unarchived package.
464  $sHost = getParam('sys_ftp_host');
465  $sLogin = getParam('sys_ftp_login');
466  $sPassword = getParam('sys_ftp_password');
467  $sPath = getParam('sys_ftp_dir');
468  if(empty($sLogin) || empty($sPassword) || empty($sPath))
469  return _t('_adm_txt_modules_no_ftp_info');
470 
471  ch_import('ChWsbFtp');
472  $oFtp = new ChWsbFtp(!empty($sHost) ? $sHost : $_SERVER['HTTP_HOST'], $sLogin, $sPassword, $sPath);
473 
474  if(!$oFtp->connect())
475  return _t('_adm_txt_modules_cannot_connect_to_ftp');
476 
477  if(!$oFtp->isCheetah())
478  return _t('_adm_txt_modules_destination_not_valid');
479 
480  $sConfigPath = $sTmpPath . $sPackageRootFolder . '/install/config.php';
481  if(!file_exists($sConfigPath))
482  return _t('_adm_txt_modules_wrong_package_format');
483 
484  include($sConfigPath);
485  if(empty($aConfig) || empty($aConfig['home_dir']) || !$oFtp->copy($sTmpPath . $sPackageRootFolder . '/', 'modules/' . $aConfig['home_dir']))
486  return _t('_adm_txt_modules_ftp_copy_failed');
487 
488  return true;
489  }
490 
491  //--- Static methods ---//
492  public static function checkForUpdates($aModule)
493  {
494  if(empty($aModule['update_url']))
495  return array();
496 
497  $sData = ch_file_get_contents($aModule['update_url'], array(
498  'uri' => $aModule['uri'],
499  'path' => $aModule['path'],
500  'version' => $aModule['version'],
501  'domain' => $_SERVER['HTTP_HOST']
502  ));
503 
504  $aValues = $aIndexes = array();
505  $rParser = xml_parser_create('UTF-8');
506  xml_parse_into_struct($rParser, $sData, $aValues, $aIndexes);
507  xml_parser_free($rParser);
508 
509  $aInfo = array();
510  if(isset($aIndexes['VERSION']))
511  $aInfo['version'] = $aValues[$aIndexes['VERSION'][0]]['value'];
512  if(isset($aIndexes['LINK']))
513  $aInfo['link'] = $aValues[$aIndexes['LINK'][0]]['value'];
514  if(isset($aIndexes['PACKAGE']))
515  $aInfo['package'] = $aValues[$aIndexes['PACKAGE'][0]]['value'];
516 
517  return $aInfo;
518  }
519 
520  //--- Protected methods ---//
521  function _parseUpdate($aInfo) {
522  $bAvailable = !empty($aInfo) && is_array($aInfo);
523 
524  return $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_update.html', array(
525  'ch_if:show_available' => array(
526  'condition' => $bAvailable,
527  'content' => array(
528  'text' => _t('_adm_txt_modules_update_text', empty($aInfo['version']) ? '' : $aInfo['version']),
529  'ch_if:show_update_view' => array(
530  'condition' => !empty($aInfo['link']),
531  'content' => array(
532  'link' => !empty($aInfo['link']) ? $aInfo['link'] : '',
533  )
534  ),
535  'ch_if:show_update_download' => array(
536  'condition' => !empty($aInfo['package']),
537  'content' => array(
538  'js_object' => CH_WSB_ADM_MM_JS_NAME,
539  'link' => !empty($aInfo['package']) ? $aInfo['package'] : '',
540  )
541  )
542  ),
543  ),
544  'ch_if:show_latest' => array(
545  'condition' => !$bAvailable,
546  'content' => array()
547  )
548  ));
549  }
550  function _perform($aDirectories, $sOperation, $aParams = array())
551  {
552  $sConfigFile = 'install/config.php';
553  $sInstallerFile = 'install/installer.php';
554  $sInstallerClass = $sOperation == 'update' ? 'Updater' : 'Installer';
555 
556  $aPlanks = array();
557  foreach($aDirectories as $sDirectory) {
558  $sPathConfig = CH_DIRECTORY_PATH_MODULES . $sDirectory . $sConfigFile;
559  $sPathInstaller = CH_DIRECTORY_PATH_MODULES . $sDirectory . $sInstallerFile;
560  if(file_exists($sPathConfig) && file_exists($sPathInstaller)) {
561  include($sPathConfig);
562  require_once($sPathInstaller);
563 
564  $sClassName = $aConfig['class_prefix'] . $sInstallerClass;
565  $oInstaller = new $sClassName($aConfig);
566  $aResult = $oInstaller->$sOperation($aParams);
567 
568  ch_import('ChWsbAlerts');
569  $o = new ChWsbAlerts('module', $sOperation, 0, 0, array('uri' => $aConfig['home_uri'], 'config' => $aConfig, 'installer' => $oInstaller, 'res' => $aResult));
570  $o->alert();
571 
572  if(!$aResult['result'] && empty($aResult['message']))
573  continue;
574  } else
575  $aResult = array(
576  'operation_title' => _t('_adm_txt_modules_process_operation_failed', $sOperation, $sDirectory),
577  'message' => ''
578  );
579 
580  $aPlanks[] = array(
581  'operation_title' => $aResult['operation_title'],
582  'ch_if:operation_result_success' => array(
583  'condition' => $aResult['result'],
584  'content' => array()
585  ),
586  'ch_if:operation_result_failed' => array(
587  'condition' => !$aResult['result'],
588  'content' => array()
589  ),
590  'message' => $aResult['message']
591  );
592  }
593 
594  return $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_results.html', array(
595  'ch_repeat:planks' => $aPlanks
596  ));
597  }
598  function _isArchive($sType)
599  {
600  $bResult = false;
601  switch($sType) {
602  case 'application/zip':
603  case 'application/x-zip-compressed':
604  $bResult = true;
605  break;
606  }
607  return $bResult;
608  }
609 }
ChWsbDb\getParam
getParam($sName, $bCache=true)
Definition: ChWsbDb.php:454
TRUE
URI MungeSecretKey $secret_key</pre >< p > If the output is TRUE
Definition: URI.MungeSecretKey.txt:17
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
ChWsbInstallerUi\actionDelete
actionDelete($aDirectories, $sType='module')
Definition: ChWsbInstallerUi.php:403
ChWsbInstallerUi\actionUpload
actionUpload($sType, $aFile, $aFtpInfo)
Definition: ChWsbInstallerUi.php:305
$sResult
$sResult
Definition: advanced_settings.php:26
ChWsbInstallerUi\actionUninstall
actionUninstall($aDirectories)
Definition: ChWsbInstallerUi.php:391
$aModule
$aModule
Definition: classifieds.php:21
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$aResult
$aResult
Definition: index.php:19
ChWsbInstallerUi\actionRecompile
actionRecompile($aDirectories)
Definition: ChWsbInstallerUi.php:395
ChWsbInstallerUi\_perform
_perform($aDirectories, $sOperation, $aParams=array())
Definition: ChWsbInstallerUi.php:550
php
ChWsbInstallerUi\$_sDefVersion
$_sDefVersion
Definition: ChWsbInstallerUi.php:14
$oZ
$oZ
Definition: db.php:20
ChWsbModuleDb
Definition: ChWsbModuleDb.php:12
ChWsbInstallerUi\getUpdates
getUpdates($sResult)
Definition: ChWsbInstallerUi.php:238
$sModule
if(!file_exists($sRayHeaderPath)) $sModule
Definition: index.php:14
CH_WSB_ADM_MM_JS_NAME
const CH_WSB_ADM_MM_JS_NAME
Definition: modules.php:16
ch_html_attribute
ch_html_attribute($mixedInput)
Definition: utils.inc.php:1324
$aInfo
$aInfo
Definition: constants.inc.php:21
$oForm
$oForm
Definition: host_tools.php:42
DesignBoxAdmin
DesignBoxAdmin($sTitle, $sContent, $mixedTopItems='', $sBottomItems='', $iIndex=1)
Definition: admin_design.inc.php:50
ChWsbInstallerUi\getUploader
getUploader($sResult, $sPackageTitleKey='_adm_txt_modules_module', $bUnsetUpdate=false, $sAction=false)
Definition: ChWsbInstallerUi.php:46
$sPassword
$sPassword
Definition: actions.inc.php:10
ChWsbAlerts
Definition: ChWsbAlerts.php:39
$sType
$sType
Definition: actions.inc.php:11
$oModuleDb
$oModuleDb
Definition: classifieds.php:20
ChWsbInstallerUi\getInstalled
getInstalled()
Definition: ChWsbInstallerUi.php:120
ChWsbInstallerUi\actionUpdate
actionUpdate($aDirectories)
Definition: ChWsbInstallerUi.php:399
ChWsbInstallerUi\actionInstall
actionInstall($aDirectories)
Definition: ChWsbInstallerUi.php:387
htmlspecialchars_adv
htmlspecialchars_adv($string)
Definition: utils.inc.php:302
ch_file_get_contents
ch_file_get_contents($sFileUrl, $aParams=array(), $sMethod='get', $aHeaders=array(), &$sHttpCode=null)
Definition: utils.inc.php:1357
$bResult
$bResult
Definition: get_file.php:11
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
time
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
Definition: license.txt:56
ChWsbInstallerUi
Definition: ChWsbInstallerUi.php:13
ch_rrmdir
ch_rrmdir($directory)
Definition: utils.inc.php:1713
$aConfig
$aConfig
Definition: config.php:8
ChWsbInstallerUi\_parseUpdate
_parseUpdate($aInfo)
Definition: ChWsbInstallerUi.php:521
ChWsbInstallerUi\getNotInstalled
getNotInstalled($sResult)
Definition: ChWsbInstallerUi.php:174
$aModules
$aModules
Definition: constants.inc.php:29
ChWsbInstallerUi\_isArchive
_isArchive($sType)
Definition: ChWsbInstallerUi.php:598
ChWsbDb\setParam
setParam($sName, $sValue)
Definition: ChWsbDb.php:459
ChWsbInstallerUi\checkForUpdatesByPath
checkForUpdatesByPath($sPath)
Definition: ChWsbInstallerUi.php:420
$aForm
$aForm
Definition: forgot.php:43
ChBaseSearchResult\showAdminActionsPanel
static showAdminActionsPanel($sWrapperId, $aButtons, $sCheckboxName='entry', $bSelectAll=true, $bSelectAllChecked=false, $sCustomHtml='')
Definition: ChBaseSearchResult.php:81
ChWsbInstallerUi\$_aCheckPathes
$_aCheckPathes
Definition: ChWsbInstallerUi.php:15
ChWsbInstallerUi\__construct
__construct()
Definition: ChWsbInstallerUi.php:39
ChWsbInstallerUi\$_aTypesConfig
$_aTypesConfig
Definition: ChWsbInstallerUi.php:16
ChWsbInstallerUi\setCheckPathes
setCheckPathes($aPathes)
Definition: ChWsbInstallerUi.php:299
$sAction
$sAction
Definition: categories.php:274
ChWsbInstallerUi\checkForUpdates
static checkForUpdates($aModule)
Definition: ChWsbInstallerUi.php:492
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
$o
$o
Definition: cmd.php:193
ChWsbDb
Definition: ChWsbDb.php:13
ChWsbInstallerUi\downloadUpdate
downloadUpdate($sLink)
Definition: ChWsbInstallerUi.php:430
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
$sName
$sName
Definition: ChWsbAdminTools.php:853
ChBaseFormView
Definition: ChBaseFormView.php:11
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
ChWsbFtp
Definition: ChWsbFtp.php:9
clear_xss
clear_xss($val)
Definition: utils.inc.php:700