Location: PHPKode > scripts > GTK Popup Menu App > popup.php
#!/usr/bin/php
<?php
//don't forget to mark it as executable (x flag in unices).
// 0.1.3-1010081651
//1011051108
// 1101311110 v0.2
require_once 'xzypopapp.php';

//------------------------------------------------------------------------
class popup2 extends xzyPopApp { //adapted/fixed for Geany IDE
	function Abrir_con_GNOME($param) {
		exec("gnome-open $param");
	}

	function Abrir_Dir_Padre($param) {
		$dir = $this->_dirname($param);
		$this->Abrir_con_GNOME($dir);
	}

	function _dirname($param) {
		if ((is_dir($param)) === true) {
			$dir = $param;
		} else {
			$dir = dirname($param);
		}
		return $dir;
	}

	function Abrir_x_Web($param) {
		$dir = $this->_dirname($param);
		$user = $_SERVER['USER'];
		$base = "/home/$user/public_html";
		if((strpos($param,$base)) !== false) {
			$path = str_replace($base,"http://localhost/~$user",$param);
			gnomeopen($path);
		} else {
			xzyDialogs::Alert('no tiene ruta web');
		}
	}


}
//------------------------------------------------------------------------

$app = new popup2;
$app->run();

?>
Return current item: GTK Popup Menu App