예제 #1
0
    function echoHTML()
    {
        jpimport('helpers.lang');
        // Get URL for JavaScript
        $jsURI_pb = JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/js/xp_progress.js';
        // Get some more HTML fragments
        $headingHTML = JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_DBEF'));
        $this->commonSAJAX();
        echo <<<ENDFRAGMENT
\t\t\t<script language="javascript" src="{$jsURI_pb}">
\t\t\t\t// WinXP Progress Bar- By Brian Gosselin- http://www.scriptasylum.com/
\t\t\t</script>
\t\t\t<script language="JavaScript" type="text/javascript">
\t\t\t\t/*
\t\t\t\t * (S)AJAX Library code
\t\t\t\t */
ENDFRAGMENT;
        sajax_show_javascript();
        echo <<<ENDFRAGMENT
\t\t \t\tsajax_fail_handle = SAJAXTrap;
\t\t
\t\t\t\tfunction SAJAXTrap( myData ) {
\t\t\t\t\talert('Invalid AJAX reponse: ' + myData);
\t\t\t\t}
\t\t\t\t\t
\t\t\t\tfunction ToggleFilter( myTable, myID ) {
\t\t\t\t\tvar sCheckStatus = (document.getElementById(myID).checked == true) ? "on" : "off";
\t\t\t
\t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "none";
\t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "block";
\t\t\t
\t\t\t\t\tx_toggleDBFilter( myTable, sCheckStatus, ToggleFilter_cb );
\t\t\t\t}
\t\t\t
\t\t\t\tfunction ToggleFilter_cb( myRet ) {
\t\t\t\t\tTablesHTML();
\t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "block";
\t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "none";
\t\t\t\t}
\t\t\t
\t\t\t\tfunction TablesHTML() {
\t\t\t\t\tx_DBSelectionHTML( cb_TablesHTML );
\t\t\t\t}
\t\t\t
\t\t\t\tfunction cb_TablesHTML( myRet ) {
\t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "block";
\t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "none";
\t\t\t\t\tdocument.getElementById("DBEFOperationList").innerHTML = myRet;
\t\t\t\t}
\t\t\t\t
\t\t\t\tfunction Reset() {
\t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "none";
\t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "block";
\t\t\t\t\tx_ResetDBEF( ToggleFilter_cb );
\t\t\t\t}
\t\t\t\t
\t\t\t\tfunction FilterNonJ()
\t\t\t\t{
\t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "none";
\t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "block";
\t\t\t\t\tx_FilterNonJoomlaTables( ToggleFilter_cb );
\t\t\t\t}
\t\t\t</script>
\t\t\t
\t\t\t<div id="DBEFProgressBar" style="display:none;" class="sitePack">
\t\t\t\t<h4>Please wait...</h4>
\t\t\t\t<script type="text/javascript">
\t\t\t\t\tvar bar0 = createBar(320,15,'white',1,'black','blue',85,7,3,"");
\t\t\t\t</script>
\t\t\t</div>
\t\t\t
\t\t\t<div id="DBEFScreen">
\t\t\t\t{$headingHTML}
\t\t\t\t<div id="DBEFOperationList">
\t\t\t\t\t<script type="text/javascript">
\t\t\t\t\t\tTablesHTML();
\t\t\t\t\t</script>
\t\t\t\t</div>
\t\t\t</div>\t\t
ENDFRAGMENT;
    }
예제 #2
0
 function getImageURI($imageName)
 {
     return JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/images/' . $imageName . '.png';
 }
 /**
  * Returns a URI to a JoomlaPack function, defined by act and task
  *
  * @param string $act The JP action to perform 
  * @param string $task The JP task (if any) associated to the action to perform
  * @param bool $nohtml Set to true in order to suppress Joomla!'s regular HTML output
  * @param string $miscOptions Any options to append to the URI
  * 
  * @return string
  */
 function JPLink($act, $task = "", $nohtml = false, $miscOptions = "")
 {
     $link = JoomlapackAbstraction::SiteURI() . '/administrator/index2.php?';
     $link .= "option=" . JoomlapackAbstraction::getParam('option', 'com_joomlapack');
     $link .= $act == "" ? "" : "&act={$act}";
     $link .= $task == "" ? "" : "&task={$task}";
     $link .= $nohtml ? "&no_html=1" : "";
     $link .= $miscOptions == "" ? "" : "&{$miscOptions}";
     return $link;
 }
예제 #4
0
    /**
     * Displays the page
     *
     */
    function echoHTML()
    {
        jpimport('helpers.lang');
        // Default to site's root folder
        $myRoot = JPATH_SITE;
        $rootArray = explode('\\', $myRoot);
        $myRoot = implode('//', $rootArray);
        // Get URL for JavaScript
        $jsURI_pb = JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/js/xp_progress.js';
        // Get some more HTML fragments
        $headingHTML = JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_SFF'));
        $this->commonSAJAX();
        ?>
			<script language="javascript" src="<?php 
        echo $jsURI_pb;
        ?>
">
				// WinXP Progress Bar- By Brian Gosselin- http://www.scriptasylum.com/
			</script>
			<script language="JavaScript" type="text/javascript">
				/*
				 * (S)AJAX Library code
				 */
				 <?php 
        sajax_show_javascript();
        ?>
		 		sajax_fail_handle = SAJAXTrap;
		
				function SAJAXTrap( myData ) {
					alert('Invalid AJAX reponse: ' + myData);
				}

				 
				 var globRoot;
				 
				function ToggleFilter( myRoot, myFile, myID ) {
					var sCheckStatus = (document.getElementById(myID).checked == true) ? "on" : "off";
			
					globRoot = myRoot;
			
					document.getElementById("DEFScreen").style.display = "none";
					document.getElementById("DEFProgressBar").style.display = "block";
			
					x_toggleFileFilter( myRoot, myFile, sCheckStatus, ToggleFilter_cb );
				}
			
				function ToggleFilter_cb( myRet ) {
					dirSelectionHTML( globRoot );
					document.getElementById("DEFScreen").style.display = "block";
					document.getElementById("DEFProgressBar").style.display = "none";
				}
			
				function dirSelectionHTML( myRoot ) {
					globRoot = myRoot;
					x_sffSelectionHTML( myRoot, cb_dirSelectionHTML );
				}
			
				function cb_dirSelectionHTML( myRet ) {
					document.getElementById("DEFScreen").style.display = "block";
					document.getElementById("DEFProgressBar").style.display = "none";
					document.getElementById("DEFOperationList").innerHTML = myRet;
				}
			</script>
			
			<div id="DEFProgressBar" style="display:none;" class="sitePack">
				<h4>Please wait...</h4>
				<script type="text/javascript">
					var bar0 = createBar(320,15,'white',1,'black','blue',85,7,3,"");
				</script>
			</div>
			
			<div id="DEFScreen">
				<?php 
        echo $headingHTML;
        ?>
				<div id="DEFOperationList">
					<script type="text/javascript">
						dirSelectionHTML('<?php 
        echo $myRoot;
        ?>
');
					</script>
				</div>
			</div>	
		<?php 
    }
예제 #5
0
 function _getNewURI($finished = false, $error = false)
 {
     $option = JoomlapackAbstraction::getParam('option');
     $key = JoomlapackAbstraction::getParam('key');
     $dummy = JoomlapackAbstraction::getParam('dummy', 0);
     $tweak = JoomlapackAbstraction::getParam('tweak', 'http');
     $dummy++;
     if ($finished) {
         if ($error) {
             return JoomlapackAbstraction::SiteURI() . "/index2.php?option={$option}&act=fullbackup&task=finished&error=1&key={$key}&no_html=1";
         } else {
             return JoomlapackAbstraction::SiteURI() . "/index2.php?option={$option}&act=fullbackup&task=finished&key={$key}&no_html=1";
         }
     } else {
         return JoomlapackAbstraction::SiteURI() . "/index2.php?option={$option}&act=fullbackup&task=continue&key={$key}&no_html=1&dummy={$dummy}&tweak={$tweak}";
     }
 }
예제 #6
0
    /**
     * Outputs the JavaScript required for AJAX calls to work
     * 
     * @access private
     */
    function _renderJavaScript()
    {
        $this->commonSAJAX();
        // Start JS tag
        echo <<<JSFRAGEND
\t\t\t<script type="text/JavaScript">
\t\t\t/*
\t \t\t* (S)AJAX Library code
\t \t\t*/\t \t\t
JSFRAGEND;
        // Display (S)AJAX code
        sajax_show_javascript();
        echo <<<JSFRAGEND
\t\t\t</script>
JSFRAGEND;
        echo '<script type="text/javascript" src="' . JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/js/pack.js"></script>';
    }
예제 #7
0
    /**
     * Displays the HTML for this page, directly outputting it to the browser
     */
    function echoHTML()
    {
        jpimport('helpers.lang');
        // 1.1.1b2 - Oops! This page wouldn't work on at least 1 windows system
        $myRoot = JPATH_SITE;
        $rootArray = explode('\\', $myRoot);
        $myRoot = implode('//', $rootArray);
        // Get URL for JavaScript
        $jsURI_pb = JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/js/xp_progress.js';
        // Get some more HTML fragments
        $headingHTML = JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_DEF'));
        $this->commonSAJAX();
        echo <<<ENDFRAGMENT
\t\t\t<script language="javascript" src="{$jsURI_pb}">
\t\t\t\t// WinXP Progress Bar- By Brian Gosselin- http://www.scriptasylum.com/
\t\t\t</script>
\t\t\t<script language="JavaScript" type="text/javascript">
\t\t\t\t/*
\t\t\t\t * (S)AJAX Library code
\t\t\t\t */
ENDFRAGMENT;
        sajax_show_javascript();
        echo <<<ENDFRAGMENT
\t\t \t\tsajax_fail_handle = SAJAXTrap;
\t\t
\t\t\t\tfunction SAJAXTrap( myData ) {
\t\t\t\t\talert('Invalid AJAX reponse: ' + myData);
\t\t\t\t}
\t\t\t\t\t\t
\t\t\t\tvar globRoot;
\t\t\t
\t\t\t\tfunction ToggleFilter( myRoot, myDir, myID ) {
\t\t\t\t\tvar sCheckStatus = (document.getElementById(myID).checked == true) ? "on" : "off";
\t\t\t
\t\t\t\t\tglobRoot = myRoot;
\t\t\t
\t\t\t\t\tdocument.getElementById("DEFScreen").style.display = "none";
\t\t\t\t\tdocument.getElementById("DEFProgressBar").style.display = "block";
\t\t\t
\t\t\t\t\tx_toggleDirFilter( myRoot, myDir, sCheckStatus, ToggleFilter_cb );
\t\t\t\t}
\t\t\t
\t\t\t\tfunction ToggleFilter_cb( myRet ) {
\t\t\t\t\tdirSelectionHTML( globRoot );
\t\t\t\t\tdocument.getElementById("DEFScreen").style.display = "block";
\t\t\t\t\tdocument.getElementById("DEFProgressBar").style.display = "none";
\t\t\t\t}
\t\t\t
\t\t\t\tfunction dirSelectionHTML( myRoot ) {
\t\t\t\t\tglobRoot = myRoot;
\t\t\t\t\tx_dirSelectionHTML( myRoot, cb_dirSelectionHTML );
\t\t\t\t}
\t\t\t
\t\t\t\tfunction cb_dirSelectionHTML( myRet ) {
\t\t\t\t\tdocument.getElementById("DEFScreen").style.display = "block";
\t\t\t\t\tdocument.getElementById("DEFProgressBar").style.display = "none";
\t\t\t\t\tdocument.getElementById("DEFOperationList").innerHTML = myRet;
\t\t\t\t}
\t\t\t</script>
\t\t\t
\t\t\t<div id="DEFProgressBar" style="display:none;" class="sitePack">
\t\t\t\t<h4>Please wait...</h4>
\t\t\t\t<script type="text/javascript">
\t\t\t\t\tvar bar0 = createBar(320,15,'white',1,'black','blue',85,7,3,"");
\t\t\t\t</script>
\t\t\t</div>
\t\t\t
\t\t\t<div id="DEFScreen">
\t\t\t\t{$headingHTML}
\t\t\t\t<div id="DEFOperationList">
\t\t\t\t\t<script type="text/javascript">
\t\t\t\t\t\tdirSelectionHTML('{$myRoot}');
\t\t\t\t\t</script>
\t\t\t\t</div>
\t\t\t</div>\t\t
ENDFRAGMENT;
    }
예제 #8
0
    case "config":
        // Configuration screen
        if (!JoomlapackAbstraction::isSAJAX() && $task != 'save') {
            echo '<link rel="stylesheet" href="components/' . $option . '/assets/css/jpcss.css" type="text/css" />';
        }
        switch ($task) {
            case "apply":
                $configuration =& JoomlapackConfiguration::getInstance();
                $configuration->SaveFromPost();
                jpackScreens::fConfig();
                break;
            case "save":
                $configuration =& JoomlapackConfiguration::getInstance();
                $configuration->SaveFromPost();
                $skipFooter = true;
                $uri = JoomlapackAbstraction::SiteURI() . '/administrator/index.php?option=' . JoomlapackAbstraction::getParam('option', 'com_joomlapack');
                $html = JoomlapackLangManager::_('CONFIG_CONT_LINE1') . ' <a href="' . $uri . '">' . JoomlapackLangManager::_('CONFIG_CONT_LINE2') . '</a> ' . JoomlapackLangManager::_('CONFIG_CONT_LINE3');
                echo <<<ENDSNIPPET
\t\t\t\t<script language="Javascript" type="text/javascript">
\t\t\t\twindow.location="{$uri}";
\t\t\t\t</script>
\t\t\t\t<noscript>
\t\t\t\t{$html}
\t\t\t\t</noscript>
ENDSNIPPET;
                //jpackScreens::fMain();
                break;
            case "cancel":
                jpackScreens::fMain();
                break;
            default:
예제 #9
0
 function sajax_get_my_uri()
 {
     return JoomlapackAbstraction::SiteURI() . '/administrator/index2.php';
     /*
     // ---- COPYLIFTED FROM JOOMLA! 1.5.3 --- START
     // Determine if the request was over SSL (HTTPS)
     if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) {
     	$https = 's://';
     } else {
     	$https = '://';
     }
     	
     //
     // Since we are assigning the URI from the server variables, we first need
     // to determine if we are running on apache or IIS.  If PHP_SELF and REQUEST_URI
     // are present, we will assume we are running on apache.
     ///
     if (!empty ($_SERVER['PHP_SELF']) && !empty ($_SERVER['REQUEST_URI'])) {
     	
     	//
     	// To build the entire URI we need to prepend the protocol, and the http host
     	// to the URI string.
     	//
     	$theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     	
     //
     // Since we do not have REQUEST_URI to work with, we will assume we are
     // running on IIS and will therefore need to work some magic with the SCRIPT_NAME and
     // QUERY_STRING environment variables.
     //
     }
      else
      {
     	// IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS
     	$theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
     	
     	// If the query string exists append it to the URI string
     	if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
     		$theURI .= '?' . $_SERVER['QUERY_STRING'];
     	}
     }
     	
     // Now we need to clean what we got since we can't trust the server var
     $theURI = urldecode($theURI);
     $theURI = str_replace('"', '&quot;',$theURI);
     $theURI = str_replace('<', '&lt;',$theURI);
     $theURI = str_replace('>', '&gt;',$theURI);
     $theURI = preg_replace('/eval\((.*)\)/', '', $theURI);
     $theURI = preg_replace('/[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']/', '""', $theURI);
     // ---- COPYLIFTED FROM JOOMLA! 1.5.3 --- END
     
     $myURI = $theURI;
     
     $upto = strpos($myURI, "?");
     if (is_numeric($upto)) {
     	$myArray = str_split($myURI, $upto);
     	$myURI = $myArray[0];
     	//FIX 1.0.4: On a host, the AJAX proxy was beggining with double slash (//administrator/...)
     	if (strstr($myURI, '//')) {
     		$myURI = str_replace('//', '/', $myURI);
     		$myURI = str_replace('http:/', 'http://', $myURI); // ...but don't whack the http:// or https:// protocol string!
     		$myURI = str_replace('https:/', 'https://', $myURI);
     	}
     }
     return $myURI;
     */
 }