";
return $out;
}//end cb_table
//Trae el pulldown con los valores de una tabla id nombre
function pd($name,$sql,$value,$optional=true){
$out= "";
return $out;
}//end pd_lookup
function pd_lookup($name,$table,$value,$optional=true)
{
return tools::pd($name,"SELECT id, nombre FROM $table ORDER BY nombre",$value,$optional);
}
function cb_div($param1,$param2=NULL,$width=NULL,$width_col=NULL){
if(is_array($param1))
{
$name =$param1['name'];
$id_prefix =$param1['id_prefix'];
$rs =$param1['rs'];
$width =$param1['width'];
$width_col =$param1['width_col'];
$extra_tag =$param1['extra_tag'];
$img =$param1['img'];
}
else
{
$name=$param2;
$rs=$param2;
}
if(!$width)
$width=1;
if(!$id_prefix)
$id_prefix=$name;
if(!$rs)
return false;
if(!$rs->nrows())
return;
$out="
}//end play
}
?>
class time_control{
var $name;
var $value;
//constructor
function time_control($name,$value)
{
$this->name=$name;
$this->value=$value;
}//end constructor
function play(){
static $function_time_update;//valvula para poner solo una vez la funcion de javascript
list($h,$m,$s)=explode(":",$this->value); //solo se usa h y m
if(!$function_time_update===true)
{
$function_time_update=true;
?>
}//end if function calendar_update
?>
:
}//end play
}
?>
class uploader_files{
var $name;
var $value;
var $max=0; //number of uploads
var $rstring;
var $ext;
var $size;
var $use_prev=1;//enable previous images? YES by default
var $own_descriptions=false; //IF true descriptions will be stored only for the specified article
var $article; //Used in conjunction with own_descriptions.
function uploader_files($_name=NULL,$_value=NULL){
$this->name=$_name;
$this->value=$_value;
}//end constructor
function play($_name=NULL,$_value=NULL)
{
if($_name)
{
$name=$_name;
$this->name=$_name;
}
else
$name=$this->name;
if($_value)
$value=$_value;
else
$value=$this->value;
?>
//This hidden is used by the function save_descriptions(), after posting the "opener" form.
//It tells the function which fields should process
if($this->own_descriptions)
{
?>
}
?>
if(!defined("CLASS_UPLOADER_FILES_OPEN"))
{
define("CLASS_UPLOADER_FILES_OPEN",true)
?>
}//end if defined
?>
}//end play
function display_thumbs($set_images,$own_descriptions,$copy_values=false){
//////////////////////////////////////////////////////////////
//atencion:
//El html generado aqui tambien se usa dentro de una string de javascript (al cerrar el popup)
//por eso no debe contener saltos de lineas ni comillas dobles
//////////////////////////////////////////////////////////////
//If article was specified, bring descriptions from the corresponding table
//NOTE: "Specific descriptions" are independent from the images related to the article
// by the set. We should bring the images from the set in the field 'images'.
// Not from the rows in the 'articles_images' table.
if($own_descriptions)
{
$res=msq("SELECT archivos.id,
archivos.archivo,
nf.descripcion
FROM archivos
LEFT JOIN notas_archivos nf
ON nf.nota='".$this->article."'
AND archivos.id=nf.foto
WHERE FIND_IN_SET(archivos.id,'$set_images')
GROUP BY archivos.id
ORDER BY FIND_IN_SET(archivos.id,'$set_images')
");
//Use name to identify controls from other possible instances of the uploader
$name=$this->name;
if(!$name)
$name=$_GET['name'];
}
else
$res=msq("SELECT id,archivo,descripcion FROM archivos WHERE FIND_IN_SET(id,'$set_images') ORDER BY FIND_IN_SET(id,'$set_images')");
if(mysql_num_rows($res))
{
echo "
"
."";
if(!$own_descriptions) //single line if not "own descriptions"
"
";
$printed_col=0;
while($row=fah($res))
{
//Busco icono
$icon_ext=substr($row['archivo'],-3);
switch($icon_ext)
{
case "pdf":
$icon="icon-pdf.png";
break;
case "doc":
$icon="icon-doc.png";
break;
case "ppt":
$icon="icon-ppt.png";
break;
case "xls":
$icon="icon-xls.png";
break;
case "txt":
$icon="icon-file.png";
break;
default:
$icon="icon-file.png";
}
$f_icon="/system/uploader_files/icons/".$icon;
if($own_descriptions) //multiple lines with "own descriptions"
"
";
?>
echo $row['descripcion']?>
if($own_descriptions)
{
?>
'/>
}
if($own_descriptions)//multiple line close
echo "
";
$printed_col++;
}
if(!$own_descriptions) //single line close
echo "";
echo "
";
}
}//end function display_thumbs
////////////////////////////////////////
// save_descriptions()
////////////////////////////////////////
//
// Use this function in action.php
// after saving the article. It stores
// the images descriptions.
////////////////////////////////////////
function save_descriptions($article){
//For each field which had own descriptions, we'll process
//the images specified in it.
//Note that the model doesn't allow the same image to have
//different descriptions among the same article
$fields=$_POST['uploader_own_descriptions_fields'];
if(count($fields))
foreach($fields as $field)
{
$images_ids=@explode(",",$_POST[$field]);
//Now, for each image save an "attached" description in the table articles_images
if(count($images_ids))
foreach($images_ids as $image_id)
{
$description=$_POST['uploader_'.$field.'_image_'.$image_id.'_description'];
//Attach description only if it is not empty
if($description!='')
{
$sql_set="SET nota=$article,foto=$image_id,descripcion='$description'";
//relationship id
$id_rel=msv("SELECT id FROM notas_archivos WHERE nota=$article AND foto=$image_id");
if($id_rel)
{
mse("UPDATE notas_archivos $sql_set WHERE id=$id_rel");
}
else
{
mse("INSERT INTO notas_archivos $sql_set");
$id_rel=mysql_insert_id();
}
$arr_keep[]=$id_rel;
}
}//end foreach image in a field
}//end foreach field
//Delete removed by user or with empty description
$set_keep=@implode(",",$arr_keep);
mse("DELETE FROM notas_archivos WHERE nota=$article AND !FIND_IN_SET(id,'$set_keep')");
}//end save_descriptions()
}//end class uploader
?>
class date_control{
var $name; //nombre del input
var $value;
//constructor
function date_control($name,$value=NULL)
{
$this->name=$name;
$this->value=$value;
}//end constructor
function play(){
static $function_date_update;//valvula para poner solo una vez la funcion de javascript
list($anio,$mes,$dia)=explode("-",$this->value);
?>
if(!$function_date_update===true)
{
$function_date_update=true;
?>
}//end if function date_update
?>
Día:
Mes:
Año:
}//end play
}
?>
//COLORAMA Old system.php versions compatibility. Should avoid in the future
include_once(ABS_PATH."/system/richedit/richedit.php");
?>
class single_uploader{
var $name;
var $value;
var $max=0; //number of uploads
var $rstring;
var $use_prev=1;//enable previous images? YES by default
var $own_descriptions=false; //IF true descriptions will be stored only for the specified article
var $article; //Used in conjunction with own_descriptions.
function single_uploader($_name=NULL,$_value=NULL){
$this->name=$_name;
$this->value=$_value;
$this->nota=$_nota;
}//end constructor
function play($_name=NULL,$_value=NULL)
{
if($_name)
{
$name=$_name;
$this->name=$_name;
}
else
$name=$this->name;
if($_value)
$value=$_value;
else
$value=$this->value;
if($this->rstring)
$rstring=$this->rstring;
else
$rstring=SYSTEM_RSTRING;//use system default resize string
?>
/**/?>
//echo $this->display_thumbs($this->value,$this->own_descriptions); //AGREGADO POR PABLO ?>
/*
//Trae el Valor Original de la BD la primera vez que se muestra ?>
echo $this->display_thumbs($this->value,$name); //AGREGADO POR PABLO ?>
}//end play
function display_thumbs($set_images,$name){
//////////////////////////////////////////////////////////////
//atencion:
//El html generado aqui tambien se usa dentro de una string de javascript (al cerrar el popup)
//por eso no debe contener saltos de lineas ni comillas dobles
//////////////////////////////////////////////////////////////
//echo "SET_IMAGES".$set_images;
$res=msq("SELECT id,archivo,descripcion FROM fotos WHERE FIND_IN_SET(id,'$set_images') ORDER BY FIND_IN_SET(id,'$set_images')");
if(mysql_num_rows($res))
{
echo "