Ejemplo n.º 1
0
function arr2link($arr, $utf8c = false)
{
    $dialogos = '';
    $divis = '';
    $att = array('width' => $arr['ancho'], 'height' => $arr['alto'], 'scrollbars' => 'Yes', 'status' => 'Yes', 'resizable' => 'Yes', 'screenx' => "'+((screen.availWidth/2)-" . intval($arr['ancho'] / 2) . ")+'", 'screeny' => "'+((screen.availHeight/2)-" . intval($arr['alto'] / 2) . ")+'");
    $indi = parsePattern($arr['ejecutar']);
    if ($utf8c) {
        $arr['titulo'] = utf8_encode($arr['titulo']);
        $arr['mensaje'] = utf8_encode($arr['mensaje']);
    }
    if ($arr['target'] == 'popu') {
        $ejecutar = anchor_popup($indi, $arr['titulo'], $att);
    } elseif ($arr['target'] == 'tab') {
        $ejecutar = anchor_popup($indi, $arr['titulo']);
        $ejecutar = str_replace('_blank', '_nt' . $arr['modulo'], $ejecutar);
    } elseif ($arr['target'] == 'javascript') {
        $ejecutar = "<a href='javascript:" . str_replace('\'', "\\'", $indi) . "' title='" . $arr['mensaje'] . "'>" . $arr['titulo'] . "</a>";
    } elseif ($arr['target'] == 'dialogo') {
        $ejecutar = "<a href='javascript:void(0);' title='" . $arr['mensaje'] . "' onclick='f" . $arr['modulo'] . "();'>" . $arr['titulo'] . "</a> ";
        $dialogos .= '<script>';
        $dalto = $arr['alto'] - 100;
        $dancho = $arr['ancho'];
        $ialto = $arr['alto'] - 180;
        $iancho = $arr['ancho'] - 50;
        //$(function(){
        $dialogos .= '
			$("#d' . $arr['modulo'] . '").dialog({
				autoOpen:false, modal:false, width:' . $dancho . ', height:' . $dalto . ',minimize: "#toolbar",
				open: function(ev, ui){$(\'#d' . $arr['modulo'] . '\').html(\'<iframe src="' . base_url() . $indi . '" width="100%", height="100%"  seamless></iframe>\');}
			}).dialogExtend({"maximizable":true,"minimizable":true,"dblclick":"maximize","icons":{"maximize":"ui-icon-arrow-4-diag" },"icons":{"minimize":"ui-icon-circle-minus"}});
			function f' . $arr['modulo'] . '(){$("#d' . $arr['modulo'] . '").dialog("open");}
		';
        $dialogos .= '</script>';
        $divis .= '<div id="d' . $arr['modulo'] . '" title="' . $arr['titulo'] . ' (' . $arr['modulo'] . ')"></div>';
    } elseif ($arr['target'] == 'ajax') {
        $ejecutar = "<a href='javascript:void(0);' title='" . $arr['mensaje'] . "' onclick='f" . $arr['modulo'] . "();'>" . $arr['titulo'] . "</a> ";
        $dialogos .= '<script>';
        $dalto = $arr['alto'] - 100;
        $dancho = $arr['ancho'];
        $ialto = $arr['alto'] - 180;
        $iancho = $arr['ancho'] - 50;
        //$(function(){base_url().$indi
        $dialogos .= '
			$("#d' . $arr['modulo'] . '").dialog({
				autoOpen:false, modal:false, width:' . $dancho . ', height:' . $dalto . ',minimize: "#toolbar"
			}).dialogExtend({"maximizable":true,"minimizable":true,"dblclick":"maximize","icons":{"maximize":"ui-icon-arrow-4-diag" },"icons":{"minimize":"ui-icon-circle-minus"}});
			function f' . $arr['modulo'] . '(){$("#d' . $arr['modulo'] . '").load("' . base_url() . $indi . '").dialog("open");}
		';
        $dialogos .= '</script>';
        $divis .= '<div id="d' . $arr['modulo'] . '" title="' . $arr['titulo'] . ' (' . $arr['modulo'] . ')"></div>';
    } else {
        $ejecutar = anchor($indi, $arr['titulo']);
    }
    return $ejecutar . $divis . $dialogos;
}
Ejemplo n.º 2
0
function arr2link($arr)
{
    $att = array('width' => $arr['ancho'], 'heigth' => $arr['alto'], 'scrollbars' => 'Yes', 'status' => 'Yes', 'resizable' => 'Yes', 'screenx' => "'+((screen.availWidth/2)-" . intval($arr['ancho'] / 2) . ")+'", 'screeny' => "'+((screen.availHeight/2)-" . intval($arr['alto'] / 2) . ")+'");
    $indi = parsePattern($arr['ejecutar']);
    if ($arr['target'] == 'popu') {
        $ejecutar = anchor_popup($indi, $arr['titulo'], $att);
        $arr['titulo'] = htmlentities($arr['titulo']);
        $arr['mensaje'] = htmlentities($arr['mensaje']);
    } elseif ($arr['target'] == 'javascript') {
        $ejecutar = "<a href='javascript:" . str_replace("'", "\\'", $indi) . "' title='{$arr['mensaje']}'>{$arr['titulo']}</a> ";
    } else {
        $ejecutar = anchor($indi, $arr['titulo']);
    }
    return $ejecutar;
}