return $message . $inputbox;
 }
 function installCB_Plugin()
 {
     $html = '';
     $message = '';
     $autoSubmit = '';
     $errorMsg = '';
     $db =& JFactory::getDBO();
     $this->frontendPath = JPATH_ROOT . DS . 'components' . DS . 'com_community_acl' . DS;
     $this->backendPath = JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_community_acl' . DS;
     $html = '<div id="timer" style="display:none"></div>';
     $html .= '<div id="installSuccesMsg"><div id="timer"></div><div style="width:100%; float:left;">' . JText::_('Extracting Files...') . '</div><br/>';
     $default_link = rtrim(JURI::root(), '/') . '/administrator/index.php?option=com_community_acl&task=install&step=5';
     $installCB_link = rtrim(JURI::root(), '/') . '/administrator/index.php?option=com_community_acl&task=install&step=4&installCB=yes';
     $installCB = JRequest::getVar('installCB');
     if ($installCB != 'yes') {
         $autoSubmit .= caclInstaller::getAutoSubmitFunction();
         $html .= $autoSubmit;
         $html .= "</div>\r\r\n\t\t\t<table><tr><td><h3>Would you like to install Community Builder Plugin?</h3></td></tr>\r\r\n\t\t\t<tr><td><input type=\"button\" id=\"btnYes\" name=\"btnYes\" value=\"Yes\" onclick=\"window.location='" . $installCB_link . "'\" /></td>\r\r\n\t\t\t<td><input type=\"button\" id=\"btnNo\" name=\"btnNo\" value=\"No\" onclick=\"window.location='" . $default_link . "'\" /></td></tr>\r\r\n\t\t\t</table>";
     }
     if ($installCB == 'yes') {
         //Install CB Plugin
         #update comprofiler table
         caclInstaller::updateCB_db();
         $cb_plugin_zip = $this->frontendPath . 'plug_cacl_userreg.zip';
         #unzip Joomla File
         $destination = JPATH_ROOT . DS . 'components' . DS . 'com_comprofiler/plugin/user/plug_communityaclregistrationplugin/';
         $plg_destination = $destination;
         if (caclInstaller::extractArchive($cb_plugin_zip, $plg_destination)) {
             $autoSubmit .= caclInstaller::getAutoSubmitFunction();
             $message .= $autoSubmit . $html;
             //Inject the Insert query into DB
             $query = "SELECT element FROM #__comprofiler_plugin WHERE `element` = 'userreg'";
             $db->setQuery($query);
             $element = $db->loadResult();
             if ($element) {
                 //it exists
                 #- Delete the record
                 $query = "DELETE FROM #__comprofiler_plugin WHERE `element` = 'userreg'";
                 $db->setQuery($query);
                 $db->query();
             }
             #- Insert record into DB
             $query = "INSERT INTO `#__comprofiler_plugin`\r\r\n\t\t\t\t\t\t\t(`id`, `name`, `element`, `type`, `folder`, `backend_menu`, `access`, `ordering`, `published`, `iscore`,\r\r\n\t\t\t\t\t\t\t\t`client_id`, `checked_out`, `checked_out_time`, `params`)\r\r\n\t\t\t\t\t\t\t\t\tVALUES ('', 'Community ACL Registration Plugin', 'userreg',\r\r\n\t\t\t\t\t\t\t\t\t\t'user', 'plug_cacl_userreg', '', 0, 99, 1, 0, 0, 0, '0000-00-00 00:00:00', '')";
             $db->setQuery($query);
             $db->query();
         } else {
             $errorMsg .= "<p style='color:red'>Unable to extract plug_cacl_userreg.zip</p>";
             $message .= $html . $errorMsg;
         }
         $link = rtrim(JURI::root(), '/') . '/administrator/index.php?option=com_community_acl&task=install&step=5';
         $inputbox = "</div></div><div ><table width=\"100%\" border=\"0\"><tr><td><input type=\"button\" class=\"button-next\" onclick=\"window.location = '" . $link . "'\" value=\"Finish\"/>\r\r\n\t\t\t\t\t\t</td></tr></table></div>";
         $message .= $inputbox;
     }