' . JText::_('COM_PHOCAGALLLERY_INSTALL_TEXT') . '

'; $folder[0][0] = 'images/phocagallery/' ; $folder[0][1] = JPATH_ROOT . '/'. $folder[0][0]; $folder[1][0] = 'images/phocagallery/avatars/'; $folder[1][1] = JPATH_ROOT . '/' . $folder[1][0]; $message = ''; $error = array(); foreach ($folder as $key => $value) { if (!JFolder::exists( $value[1])) { if (JFolder::create( $value[1], 0755 )) { $data = "\n\n\n"; JFile::write($value[1]. '/'. "index.html", $data); $message .= '
Folder ' . $value[0] .' created!
'; $error[] = 0; } else { $message .= '
Folder ' . $value[0] .' creation failed! Please create it manually.
'; $error[] = 1; } } else//Folder exist { $message .= '
Folder ' . $value[0] .' exists!
'; $error[] = 0; } } //$app = JFactory::getApplication(); //$app->redirect(JRoute::_('index.php?option=com_phocagallery'), $message); JFactory::getApplication()->enqueueMessage($message); $parent->getParent()->setRedirectURL('index.php?option=com_phocagallery'); } function uninstall($parent) { //echo '

' . JText::_('COM_PHOCAGALLLERY_UNINSTALL_TEXT') . '

'; } function update($parent) { //echo '

' . JText::sprintf('COM_PHOCAGALLERY_UPDATE_TEXT', $parent->get('manifest')->version) . '

'; $folder[0][0] = 'images/phocagallery/' ; $folder[0][1] = JPATH_ROOT . '/'. $folder[0][0]; $folder[1][0] = 'images/phocagallery/avatars/'; $folder[1][1] = JPATH_ROOT . '/' . $folder[1][0]; $message = ''; $error = array(); foreach ($folder as $key => $value) { if (!JFolder::exists( $value[1])) { if (JFolder::create( $value[1], 0755 )) { $data = "\n\n\n"; JFile::write($value[1]. '/'. "index.html", $data); $message .= '
Folder ' . $value[0] .' created!
'; $error[] = 0; } else { $message .= '
Folder ' . $value[0] .' creation failed! Please create it manually.
'; $error[] = 1; } } else//Folder exist { $message .= '
Folder ' . $value[0] .' exists!
'; $error[] = 0; } } $msg = JText::_('COM_PHOCAGALLERY_UPDATE_TEXT'); $msg .= ' (' . JText::_('COM_PHOCAGALLERY_VERSION'). ': ' . $parent->get('manifest')->version . ')'; $msg .= '
'. $message; $app = JFactory::getApplication(); $app->enqueueMessage($msg); $app->redirect(JRoute::_('index.php?option=com_phocagallery')); } function preflight($type, $parent) { //echo '

' . JText::_('COM_PHOCAGALLERY_PREFLIGHT_' . $type . '_TEXT') . '

'; } function postflight($type, $parent) { //echo '

' . JText::_('COM_PHOCAGALLERY_POSTFLIGHT_' . $type . '_TEXT') . '

'; } }