Autor Zpráva
Radek Sabáček
Profil
Zdravím,
potřeboval bych, aby se místoZobrazit dokument v bublině zobrazil název souboru, klidně i s koncovkou. Lze to? Jsem začátečník, tak se omlouvám za pro Vás možná banální dotaz..


$image = '<img src="'.JURI::base().'components/com_urednideska/assets/images/'.$file.'" align="bottom" title="Zobrazit dokument" alt="Zobrazit dokument" />'; 
    return $image;
  }
  
  function format_bytes($size) {
    $units = array(' B', ' kB', ' MB', ' GB', ' TB');
    for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;
    return str_replace('.',',',round($size, 0)).$units[$i];
  }
NoxOne
Profil *
$image = '<img src="'.JURI::base().'components/com_urednideska/assets/images/'.$file.'" align="bottom" title="'.$file.'" alt="Zobrazit dokument" />';

myslím že jednodužší to nebude. :)
Radek Sabáček
Profil
NoxOne:
Děkuji za odpověď. Asi jsem to předtím špatně vysvětlil. Mám vždy malý obrázek v gif,a ten odkazuje na soubor. A název tohoto souboru v odkazu potřebuju zobrazit. Teď to v bublině zobrazuje pdf.gif, což je název obrázku. Děkuji
Keeehi
Profil
Radek Sabáček:
Část jsem si musel domyslet, protože si to sem nenapsal. Obecně musíš začít tam, kde se vytváří odkaz na ten soubor, ne až u obrázku, který je uvnitř toho odkazu.
    function getImage($file, $filename) {
        $image = '<img src="'.JURI::base().'components/com_urednideska/assets/images/'.$file.'" align="bottom" title="Zobrazit '.$filename.'" alt="Zobrazit dokument" />'; 
        return $image;
    }
    
    
    ...
$filename = 'soubor.pdf';
echo '<a href="'.JURI::base().'components/com_urednideska/files/'.$filename.'">'.getImage('pdf.gif', $filename).'</a>';  
Radek Sabáček
Profil
Keeehi:
Aha. Tak na to jsem asi krátkej :-) Hodím to sem pro jistotu celé. Kdybyste se na to mrkli, a opravili, budu rád. Díky!
<?php
/**
 * @version        1.0.0 uredni deska $
 * @package        uredni_deska
 * @copyright    Copyright © 2010 - All rights reserved.
 * @license        GNU/GPL
 * @author        
 * @author mail    nobody@nobody.com
 *
 *
 * @MVC architecture generated by MVC generator tool at http://www.alphaplug.com
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

class urednideskaHelper
{
/*    function __construct() {

   $params = JComponentHelper::getParams ('com_urednideska'); 
    
    parent::__construct();
    } */ 
  
  function ikona ($extension,$name,$ikona) {
    if ($ikona == 0) {
      $text = '<span title="Zobrazit soubor">'.$extension.'</span>'; 
      return $text;  
    }   
    
    switch ($extension)
    {
      case 'doc':
      case 'docx':
        $file = 'doc.gif';
      break;
      case 'xls':
      case 'xlsx':
        $file = 'xls.gif';
      break;
      case 'jpg':
      case 'gif':
        $file = 'jpg.gif';
      break;
      case 'txt':
        $file = 'txt.gif';
      break;
      case 'pdf':
        $file = 'pdf.gif';
      break;
      case 'zip':
        $file = 'zip.gif';
      break;
      default:
        $file = 'default.gif';
      
    }

    $image = '<img src="'.JURI::base().'components/com_urednideska/assets/images/'.$file.'" align="bottom" title="'.$file.'" alt="Zobrazit dokument" />'; 
    return $image;
  }
  
  function format_bytes($size) {
    $units = array(' B', ' kB', ' MB', ' GB', ' TB');
    for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;
    return str_replace('.',',',round($size, 0)).$units[$i];
  }

    function soubor2 ($id,$file,$filename,$extension) {
    $params = JComponentHelper::getParams ('com_urednideska');
    $dir = JPATH_ROOT . DS . $params->get( 'adresar');
    $nazevSouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevSouboru);    
    
    $output = '<a href="../'.$this->params->get( 'adresar').$nazevSouboru.'" target="'.$this->params->get( 'link', '_blank').'">'.UrednideskaHelper::ikona ($extension,$file).'</a>';
    $output .= ' ['.UrednideskaHelper::format_bytes($filesize).']';
    return $output;  
    }
  
  function files ($pid = 0) {
        $db    =& JFactory::getDBO();
    
    if ($pid > 0) {
      $where = ' WHERE pid = '.$pid;
    }
    else {
      $where = ' WHERE 1';
    }
    
    $query = 'SELECT *'
            . ' FROM #__urednideska_files'
            . $where 
      . ' ORDER BY pid, id'
        ;

    $db->setQuery( $query );
    $files = $db->loadObjectList();
    
    return $files;    
  }

  function soubor ($id,$file,$filename,$extension,$link,$hits) {
    $params = JComponentHelper::getParams ('com_urednideska');
    $hits1 = '';
    
    $dir = JPATH_SITE.DS.$this->params->get( 'adresar'); 
    $nazevSouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevSouboru);
    
    if ($params->get( 'hits' ) == 1) $hits1 = ', <em>('.$hits.'x)</em>';   

    $output = '<a href="'.$link.'" target="'.$this->params->get( 'link').'">'.urednideskaHelper::ikona($extension,$file,$params->get( 'ikona')).'</a>';
    $output .= ' ['.urednideskaHelper::format_bytes($filesize).']'.$hits1;
    return $output;  
    }
    
  function soubor1 ($id,$file,$filename,$extension,$link,$hits) {
    $params = JComponentHelper::getParams ('com_urednideska');
    $hits1 = '';
    
    $dir = JPATH_SITE.DS.$this->params->get( 'adresar'); 
    $nazevSouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevSouboru);

    if ($params->get( 'hits' ) == 1) $hits1 = ', <em>('.$hits.'x)</em>';   

    $output = '<a href="'.$link.'" target="'.$this->params->get( 'link').'">'.urednideskaHelper::ikona($extension,$file,$params->get( 'ikona')).'</a>';
    $output .= ' <a href="'.$link.'" target="'.$this->params->get( 'link').'">'.$file.'</a>';
    $output .= ' ['.urednideskaHelper::format_bytes($filesize).']'.$hits1;
    
    return $output;  
    }
    
    function fdatum($datum) {
    $datum = StrFTime("%d.%m.%Y", strtotime($datum));
    $datum = str_replace(".0", ".", $datum);
    $num = strlen($datum);
    if(substr($datum, 0, 1) == "0") $datum = substr($datum, 1, $num);

    return $datum;
  
  }
  
  function calendar($value, $name, $id, $format = '%Y-%m-%d', $attribs = null)
    {
        JHTML::_('behavior.calendar'); //load the calendar behavior

        if (is_array($attribs)) {
            $attribs = JArrayHelper::toString( $attribs );
        }
        $document =& JFactory::getDocument();
        $document->addScriptDeclaration('window.addEvent(\'domready\', function() {Calendar.setup({
        inputField     :    "'.$id.'",     // id of the input field
        ifFormat       :    "'.$format.'",      // format of the input field
        button         :    "'.$id.'_img",  // trigger for the calendar (button ID)
        align          :    "Tr",           // alignment (defaults to "Bl")
        firstDay       :    1,
        singleClick    :    true
    });});');

        return '<input type="text" name="'.$name.'" id="'.$id.'" value="'.htmlspecialchars($value, ENT_COMPAT, 'UTF-8').'" '.$attribs.' />'.
                 '<img class="calendar" src="'.JURI::root(true).'/templates/system/images/calendar.png" alt="calendar" id="'.$id.'_img" />';
    }
    
    function stringtodate($date) {
    $day = substr($date,0,2);
    $month = substr($date,3,2);
    $year = substr($date,6,4);
    return $year.'-'.$month.'-'.$day; 
  }
  
  function fetchButton( $type='Popup', $name = '', $text = '', $url = '', $width=640, $height=480, $top=0, $left=0 )
    {
        JHTML::_('behavior.modal');

        $text    = JText::_($text);
        $class    = urednideskaHelper::fetchIconClass($name);
        $doTask    = urednideskaHelper::_getCommand($name, $url, $width, $height, $top, $left);

        $html    = "<a class=\"modal\" href=\"$doTask\" rel=\"{handler: 'iframe', size: {x: $width, y: $height}}\">\n";
        $html .= "<span class=\"$class\" title=\"$text\">\n";
        $html .= "</span>\n";
        $html    .= "$text\n";
        $html    .= "</a>\n";

        return $html;
    }

     function fetchId($name)
    {
        return $this->_parent->_name.'-'."popup-$name";
    }

  function _getCommand($name, $url, $width, $height, $top, $left)
    {
        if (substr($url, 0, 4) !== 'http') {
            $url = JURI::base().$url;
        }

        return $url;
    }
    
    function fetchIconClass($identifier)
    {
        return "icon-32-$identifier";
    }
    
    function nastaveni()
    {
        $db =& JFactory::getDBO();

        $query = 'SELECT * FROM #__urednideska_nastaveni WHERE id = 1';
        $db->setQuery($query);
        $nastaveni = $db->loadObject();

        return $nastaveni;
    }
    
    function accesstoedit () {
    $user = & JFactory::getUser();
    $params = JComponentHelper::getParams ('com_urednideska');
    
    if ($params->get('filter_groups',25) > $user->get('gid')) {
      return false;
    }
  
    return true;  
  }
    
    function adminmenu ($id, $created_by)
    {         
    $menus = &JSite::getMenu();
        $menu  = $menus->getActive();
    
    if (JRequest::getVar( 'state', '', '', 'int' ) == -1) {
    $link = 'index.php?option=com_urednideska&task=unarchive&id='.$id.'&Itemid='.$menu->id;
    $html = '<a href="'.$link.'"><img src="'.JURI::base().'components/com_urednideska/assets/images/edit.gif" align="bottom" title="Odarchivace záznamu" alt="Odarchivace záznamu" /></a>';
    }
    else { 
    $link = 'index.php?option=com_urednideska&view=editovatzaznam&id='.$id.'&Itemid='.$menu->id;
    $html = '<a href="'.$link.'"><img src="'.JURI::base().'components/com_urednideska/assets/images/edit.gif" align="bottom" title="Editace záznamu" alt="Editace záznamu" /></a>';
    $html .= '<div style="float: right;"><form name="smazatzaznam" method="post" action="'.JRoute::_( 'index.php?option=com_urednideska').'"><button style="border-width: 0px; background: none; cursor: pointer;" name="task" value="smazat" onclick="return confirm(\'Opravdu chcete smazat tento záznam?\');"><img src="'.JURI::base().'components/com_urednideska/assets/images/delete.gif" align="bottom" title="Editace záznamu" alt="Editace záznamu" /></button><input type="hidden" name="id" value="'.$id.'"/><input type="hidden" name="Itemid" value="'.$menu->id.'"/>'.JHTML::_( 'form.token' ).'</form></div>';
    }
    
    return $html;
  }
  
  function getVersionInfo() { 
    $folder = JPATH_ADMINISTRATOR .DS. 'components'.DS.'com_urednideska';
    if (JFolder::exists($folder)) { 
      $xmlFilesInDir = JFolder::files($folder, '.xml$');
    }
    else {
      $xmlFilesInDir = null;
    }
    
    $xml_items = '';
    if (count($xmlFilesInDir)) {
      foreach ($xmlFilesInDir as $xmlfile) { 
        if ($data = JApplicationHelper::parseXMLInstallFile($folder.DS.$xmlfile)) {
          foreach($data as $key => $value) {
            $xml_items[$key] = $value;
          }
        }
      }
    }
    
    return $xml_items;
  }
}


?>

<?php
/**
 * @version        1.0.0 uredni deska $
 * @package        uredni_deska
 * @copyright    copyright © 2010 - all rights reserved.
 * @license        gnu/gpl
 * @author        
 * @author mail    nobody@nobody.com
 *
 *
 * @mvc architecture generated by mvc generator tool at http://www.alphaplug.com
 */

// no direct access
defined('_jexec') or die('restricted access');

class urednideskahelper
{
/*    function __construct() {

   $params = jcomponenthelper::getparams ('com_urednideska'); 
    
    parent::__construct();
    } */ 
  
  function ikona ($extension,$name,$ikona) {
    if ($ikona == 0) {
      $text = '<span title="zobrazit soubor">'.$extension.'</span>'; 
      return $text;  
    }   
    
    switch ($extension)
    {
      case 'doc':
      case 'docx':
        $file = 'doc.gif';
      break;
      case 'xls':
      case 'xlsx':
        $file = 'xls.gif';
      break;
      case 'jpg':
      case 'gif':
        $file = 'jpg.gif';
      break;
      case 'txt':
        $file = 'txt.gif';
      break;
      case 'pdf':
        $file = 'pdf.gif';
      break;
      case 'zip':
        $file = 'zip.gif';
      break;
      default:
        $file = 'default.gif';
      
    }

    $image = '<img src="'.juri::base().'components/com_urednideska/assets/images/'.$file.'" align="bottom" title="'.$file.'" alt="zobrazit dokument" />'; 
    return $image;
  }
  
  function format_bytes($size) {
    $units = array(' b', ' kb', ' mb', ' gb', ' tb');
    for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;
    return str_replace('.',',',round($size, 0)).$units[$i];
  }

    function soubor2 ($id,$file,$filename,$extension) {
    $params = jcomponenthelper::getparams ('com_urednideska');
    $dir = jpath_root . ds . $params->get( 'adresar');
    $nazevsouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevsouboru);    
    
    $output = '<a href="../'.$this->params->get( 'adresar').$nazevsouboru.'" target="'.$this->params->get( 'link', '_blank').'">'.urednideskahelper::ikona ($extension,$file).'</a>';
    $output .= ' ['.urednideskahelper::format_bytes($filesize).']';
    return $output;  
    }
  
  function files ($pid = 0) {
        $db    =& jfactory::getdbo();
    
    if ($pid > 0) {
      $where = ' where pid = '.$pid;
    }
    else {
      $where = ' where 1';
    }
    
    $query = 'select *'
            . ' from #__urednideska_files'
            . $where 
      . ' order by pid, id'
        ;

    $db->setquery( $query );
    $files = $db->loadobjectlist();
    
    return $files;    
  }

  function soubor ($id,$file,$filename,$extension,$link,$hits) {
    $params = jcomponenthelper::getparams ('com_urednideska');
    $hits1 = '';
    
    $dir = jpath_site.ds.$this->params->get( 'adresar'); 
    $nazevsouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevsouboru);
    
    if ($params->get( 'hits' ) == 1) $hits1 = ', <em>('.$hits.'x)</em>';   

    $output = '<a href="'.$link.'" target="'.$this->params->get( 'link').'">'.urednideskahelper::ikona($extension,$file,$params->get( 'ikona')).'</a>';
    $output .= ' ['.urednideskahelper::format_bytes($filesize).']'.$hits1;
    return $output;  
    }
    
  function soubor1 ($id,$file,$filename,$extension,$link,$hits) {
    $params = jcomponenthelper::getparams ('com_urednideska');
    $hits1 = '';
    
    $dir = jpath_site.ds.$this->params->get( 'adresar'); 
    $nazevsouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevsouboru);

    if ($params->get( 'hits' ) == 1) $hits1 = ', <em>('.$hits.'x)</em>';   

    $output = '<a href="'.$link.'" target="'.$this->params->get( 'link').'">'.urednideskahelper::ikona($extension,$file,$params->get( 'ikona')).'</a>';
    $output .= ' <a href="'.$link.'" target="'.$this->params->get( 'link').'">'.$file.'</a>';
    $output .= ' ['.urednideskahelper::format_bytes($filesize).']'.$hits1;
    
    return $output;  
    }
    
    function fdatum($datum) {
    $datum = strftime("%d.%m.%y", strtotime($datum));
    $datum = str_replace(".0", ".", $datum);
    $num = strlen($datum);
    if(substr($datum, 0, 1) == "0") $datum = substr($datum, 1, $num);

    return $datum;
  
  }
  
  function calendar($value, $name, $id, $format = '%y-%m-%d', $attribs = null)
    {
        jhtml::_('behavior.calendar'); //load the calendar behavior

        if (is_array($attribs)) {
            $attribs = jarrayhelper::tostring( $attribs );
        }
        $document =& jfactory::getdocument();
        $document->addscriptdeclaration('window.addevent(\'domready\', function() {calendar.setup({
        inputfield     :    "'.$id.'",     // id of the input field
        ifformat       :    "'.$format.'",      // format of the input field
        button         :    "'.$id.'_img",  // trigger for the calendar (button id)
        align          :    "tr",           // alignment (defaults to "bl")
        firstday       :    1,
        singleclick    :    true
    });});');

        return '<input type="text" name="'.$name.'" id="'.$id.'" value="'.htmlspecialchars($value, ent_compat, 'utf-8').'" '.$attribs.' />'.
                 '<img class="calendar" src="'.juri::root(true).'/templates/system/images/calendar.png" alt="calendar" id="'.$id.'_img" />';
    }
    
    function stringtodate($date) {
    $day = substr($date,0,2);
    $month = substr($date,3,2);
    $year = substr($date,6,4);
    return $year.'-'.$month.'-'.$day; 
  }
  
  function fetchbutton( $type='popup', $name = '', $text = '', $url = '', $width=640, $height=480, $top=0, $left=0 )
    {
        jhtml::_('behavior.modal');

        $text    = jtext::_($text);
        $class    = urednideskahelper::fetchiconclass($name);
        $dotask    = urednideskahelper::_getcommand($name, $url, $width, $height, $top, $left);

        $html    = "<a class=\"modal\" href=\"$dotask\" rel=\"{handler: 'iframe', size: {x: $width, y: $height}}\">\n";
        $html .= "<span class=\"$class\" title=\"$text\">\n";
        $html .= "</span>\n";
        $html    .= "$text\n";
        $html    .= "</a>\n";

        return $html;
    }

     function fetchid($name)
    {
        return $this->_parent->_name.'-'."popup-$name";
    }

  function _getcommand($name, $url, $width, $height, $top, $left)
    {
        if (substr($url, 0, 4) !== 'http') {
            $url = juri::base().$url;
        }

        return $url;
    }
    
    function fetchiconclass($identifier)
    {
        return "icon-32-$identifier";
    }
    
    function nastaveni()
    {
        $db =& jfactory::getdbo();

        $query = 'select * from #__urednideska_nastaveni where id = 1';
        $db->setquery($query);
        $nastaveni = $db->loadobject();

        return $nastaveni;
    }
    
    function accesstoedit () {
    $user = & jfactory::getuser();
    $params = jcomponenthelper::getparams ('com_urednideska');
    
    if ($params->get('filter_groups',25) > $user->get('gid')) {
      return false;
    }
  
    return true;  
  }
    
    function adminmenu ($id, $created_by)
    {         
    $menus = &jsite::getmenu();
        $menu  = $menus->getactive();
    
    if (jrequest::getvar( 'state', '', '', 'int' ) == -1) {
    $link = 'index.php?option=com_urednideska&task=unarchive&id='.$id.'&itemid='.$menu->id;
    $html = '<a href="'.$link.'"><img src="'.juri::base().'components/com_urednideska/assets/images/edit.gif" align="bottom" title="odarchivace záznamu" alt="odarchivace záznamu" /></a>';
    }
    else { 
    $link = 'index.php?option=com_urednideska&view=editovatzaznam&id='.$id.'&itemid='.$menu->id;
    $html = '<a href="'.$link.'"><img src="'.juri::base().'components/com_urednideska/assets/images/edit.gif" align="bottom" title="editace záznamu" alt="editace záznamu" /></a>';
    $html .= '<div style="float: right;"><form name="smazatzaznam" method="post" action="'.jroute::_( 'index.php?option=com_urednideska').'"><button style="border-width: 0px; background: none; cursor: pointer;" name="task" value="smazat" onclick="return confirm(\'opravdu chcete smazat tento záznam?\');"><img src="'.juri::base().'components/com_urednideska/assets/images/delete.gif" align="bottom" title="editace záznamu" alt="editace záznamu" /></button><input type="hidden" name="id" value="'.$id.'"/><input type="hidden" name="itemid" value="'.$menu->id.'"/>'.jhtml::_( 'form.token' ).'</form></div>';
    }
    
    return $html;
  }
  
  function getversioninfo() { 
    $folder = jpath_administrator .ds. 'components'.ds.'com_urednideska';
    if (jfolder::exists($folder)) { 
      $xmlfilesindir = jfolder::files($folder, '.xml$');
    }
    else {
      $xmlfilesindir = null;
    }
    
    $xml_items = '';
    if (count($xmlfilesindir)) {
      foreach ($xmlfilesindir as $xmlfile) { 
        if ($data = japplicationhelper::parsexmlinstallfile($folder.ds.$xmlfile)) {
          foreach($data as $key => $value) {
            $xml_items[$key] = $value;
          }
        }
      }
    }
    
    return $xml_items;
  }
}


?>

aha. tak na to jsem asi krátkej :-) hodím to sem pro jistotu celé. kdybyste se na to mrkli, a opravili, budu rád. díky!
<?php
/**
 * @version        1.0.0 uredni deska $
 * @package        uredni_deska
 * @copyright    copyright © 2010 - all rights reserved.
 * @license        gnu/gpl
 * @author        
 * @author mail    nobody@nobody.com
 *
 *
 * @mvc architecture generated by mvc generator tool at http://www.alphaplug.com
 */

// no direct access
defined('_jexec') or die('restricted access');

class urednideskahelper
{
/*    function __construct() {

   $params = jcomponenthelper::getparams ('com_urednideska'); 
    
    parent::__construct();
    } */ 
  
  function ikona ($extension,$name,$ikona) {
    if ($ikona == 0) {
      $text = '<span title="zobrazit soubor">'.$extension.'</span>'; 
      return $text;  
    }   
    
    switch ($extension)
    {
      case 'doc':
      case 'docx':
        $file = 'doc.gif';
      break;
      case 'xls':
      case 'xlsx':
        $file = 'xls.gif';
      break;
      case 'jpg':
      case 'gif':
        $file = 'jpg.gif';
      break;
      case 'txt':
        $file = 'txt.gif';
      break;
      case 'pdf':
        $file = 'pdf.gif';
      break;
      case 'zip':
        $file = 'zip.gif';
      break;
      default:
        $file = 'default.gif';
      
    }

    $image = '<img src="'.juri::base().'components/com_urednideska/assets/images/'.$file.'" align="bottom" title="'.$file.'" alt="zobrazit dokument" />'; 
    return $image;
  }
  
  function format_bytes($size) {
    $units = array(' b', ' kb', ' mb', ' gb', ' tb');
    for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;
    return str_replace('.',',',round($size, 0)).$units[$i];
  }

    function soubor2 ($id,$file,$filename,$extension) {
    $params = jcomponenthelper::getparams ('com_urednideska');
    $dir = jpath_root . ds . $params->get( 'adresar');
    $nazevsouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevsouboru);    
    
    $output = '<a href="../'.$this->params->get( 'adresar').$nazevsouboru.'" target="'.$this->params->get( 'link', '_blank').'">'.urednideskahelper::ikona ($extension,$file).'</a>';
    $output .= ' ['.urednideskahelper::format_bytes($filesize).']';
    return $output;  
    }
  
  function files ($pid = 0) {
        $db    =& jfactory::getdbo();
    
    if ($pid > 0) {
      $where = ' where pid = '.$pid;
    }
    else {
      $where = ' where 1';
    }
    
    $query = 'select *'
            . ' from #__urednideska_files'
            . $where 
      . ' order by pid, id'
        ;

    $db->setquery( $query );
    $files = $db->loadobjectlist();
    
    return $files;    
  }

  function soubor ($id,$file,$filename,$extension,$link,$hits) {
    $params = jcomponenthelper::getparams ('com_urednideska');
    $hits1 = '';
    
    $dir = jpath_site.ds.$this->params->get( 'adresar'); 
    $nazevsouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevsouboru);
    
    if ($params->get( 'hits' ) == 1) $hits1 = ', <em>('.$hits.'x)</em>';   

    $output = '<a href="'.$link.'" target="'.$this->params->get( 'link').'">'.urednideskahelper::ikona($extension,$file,$params->get( 'ikona')).'</a>';
    $output .= ' ['.urednideskahelper::format_bytes($filesize).']'.$hits1;
    return $output;  
    }
    
  function soubor1 ($id,$file,$filename,$extension,$link,$hits) {
    $params = jcomponenthelper::getparams ('com_urednideska');
    $hits1 = '';
    
    $dir = jpath_site.ds.$this->params->get( 'adresar'); 
    $nazevsouboru = $id.'-'.$filename.'.'.$extension;
    $filesize = filesize($dir.$nazevsouboru);

    if ($params->get( 'hits' ) == 1) $hits1 = ', <em>('.$hits.'x)</em>';   

    $output = '<a href="'.$link.'" target="'.$this->params->get( 'link').'">'.urednideskahelper::ikona($extension,$file,$params->get( 'ikona')).'</a>';
    $output .= ' <a href="'.$link.'" target="'.$this->params->get( 'link').'">'.$file.'</a>';
    $output .= ' ['.urednideskahelper::format_bytes($filesize).']'.$hits1;
    
    return $output;  
    }
    
    function fdatum($datum) {
    $datum = strftime("%d.%m.%y", strtotime($datum));
    $datum = str_replace(".0", ".", $datum);
    $num = strlen($datum);
    if(substr($datum, 0, 1) == "0") $datum = substr($datum, 1, $num);

    return $datum;
  
  }
  
  function calendar($value, $name, $id, $format = '%y-%m-%d', $attribs = null)
    {
        jhtml::_('behavior.calendar'); //load the calendar behavior

        if (is_array($attribs)) {
            $attribs = jarrayhelper::tostring( $attribs );
        }
        $document =& jfactory::getdocument();
        $document->addscriptdeclaration('window.addevent(\'domready\', function() {calendar.setup({
        inputfield     :    "'.$id.'",     // id of the input field
        ifformat       :    "'.$format.'",      // format of the input field
        button         :    "'.$id.'_img",  // trigger for the calendar (button id)
        align          :    "tr",           // alignment (defaults to "bl")
        firstday       :    1,
        singleclick    :    true
    });});');

        return '<input type="text" name="'.$name.'" id="'.$id.'" value="'.htmlspecialchars($value, ent_compat, 'utf-8').'" '.$attribs.' />'.
                 '<img class="calendar" src="'.juri::root(true).'/templates/system/images/calendar.png" alt="calendar" id="'.$id.'_img" />';
    }
    
    function stringtodate($date) {
    $day = substr($date,0,2);
    $month = substr($date,3,2);
    $year = substr($date,6,4);
    return $year.'-'.$month.'-'.$day; 
  }
  
  function fetchbutton( $type='popup', $name = '', $text = '', $url = '', $width=640, $height=480, $top=0, $left=0 )
    {
        jhtml::_('behavior.modal');

        $text    = jtext::_($text);
        $class    = urednideskahelper::fetchiconclass($name);
        $dotask    = urednideskahelper::_getcommand($name, $url, $width, $height, $top, $left);

        $html    = "<a class=\"modal\" href=\"$dotask\" rel=\"{handler: 'iframe', size: {x: $width, y: $height}}\">\n";
        $html .= "<span class=\"$class\" title=\"$text\">\n";
        $html .= "</span>\n";
        $html    .= "$text\n";
        $html    .= "</a>\n";

        return $html;
    }

     function fetchid($name)
    {
        return $this->_parent->_name.'-'."popup-$name";
    }

  function _getcommand($name, $url, $width, $height, $top, $left)
    {
        if (substr($url, 0, 4) !== 'http') {
            $url = juri::base().$url;
        }

        return $url;
    }
    
    function fetchiconclass($identifier)
    {
        return "icon-32-$identifier";
    }
    
    function nastaveni()
    {
        $db =& jfactory::getdbo();

        $query = 'select * from #__urednideska_nastaveni where id = 1';
        $db->setquery($query);
        $nastaveni = $db->loadobject();

        return $nastaveni;
    }
    
    function accesstoedit () {
    $user = & jfactory::getuser();
    $params = jcomponenthelper::getparams ('com_urednideska');
    
    if ($params->get('filter_groups',25) > $user->get('gid')) {
      return false;
    }
  
    return true;  
  }
    
    function adminmenu ($id, $created_by)
    {         
    $menus = &jsite::getmenu();
        $menu  = $menus->getactive();
    
    if (jrequest::getvar( 'state', '', '', 'int' ) == -1) {
    $link = 'index.php?option=com_urednideska&task=unarchive&id='.$id.'&itemid='.$menu->id;
    $html = '<a href="'.$link.'"><img src="'.juri::base().'components/com_urednideska/assets/images/edit.gif" align="bottom" title="odarchivace záznamu" alt="odarchivace záznamu" /></a>';
    }
    else { 
    $link = 'index.php?option=com_urednideska&view=editovatzaznam&id='.$id.'&itemid='.$menu->id;
    $html = '<a href="'.$link.'"><img src="'.juri::base().'components/com_urednideska/assets/images/edit.gif" align="bottom" title="editace záznamu" alt="editace záznamu" /></a>';
    $html .= '<div style="float: right;"><form name="smazatzaznam" method="post" action="'.jroute::_( 'index.php?option=com_urednideska').'"><button style="border-width: 0px; background: none; cursor: pointer;" name="task" value="smazat" onclick="return confirm(\'opravdu chcete smazat tento záznam?\');"><img src="'.juri::base().'components/com_urednideska/assets/images/delete.gif" align="bottom" title="editace záznamu" alt="editace záznamu" /></button><input type="hidden" name="id" value="'.$id.'"/><input type="hidden" name="itemid" value="'.$menu->id.'"/>'.jhtml::_( 'form.token' ).'</form></div>';
    }
    
    return $html;
  }
  
  function getversioninfo() { 
    $folder = jpath_administrator .ds. 'components'.ds.'com_urednideska';
    if (jfolder::exists($folder)) { 
      $xmlfilesindir = jfolder::files($folder, '.xml$');
    }
    else {
      $xmlfilesindir = null;
    }
    
    $xml_items = '';
    if (count($xmlfilesindir)) {
      foreach ($xmlfilesindir as $xmlfile) { 
        if ($data = japplicationhelper::parsexmlinstallfile($folder.ds.$xmlfile)) {
          foreach($data as $key => $value) {
            $xml_items[$key] = $value;
          }
        }
      }
    }
    
    return $xml_items;
  }
}


?>
Keeehi
Profil
$image = '<img src="'.JURI::base().'components/com_urednideska/assets/images/'.$file.'" align="bottom" title="'.$name.'" alt="Zobrazit dokument" />';
Radek Sabáček
Profil
Keeehi:
VYŘEŠENO, děkuji mnohokrát!

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0