Login   Register  
PHP Classes
elePHPant
Icontem

File: popup.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Luis Martinez Ulloa  >  GTK Popup Menu App  >  popup.php  >  Download  
File: popup.php
Role: Example script
Content type: text/plain
Description: example script - don't forget to mark as executable (x flag in unices)
Class: GTK Popup Menu App
Create GTK popup menus bound to class functions
Author: By
Last change: Changing to static method calling in xzydialogs.php
Date: 2011-02-06 12:39
Size: 1,100 bytes
 

Contents

Class file image Download
#!/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();

?>