Main menu - ikona ? - Strona 3
Strona 3 z 4 PierwszyPierwszy 1234 OstatniOstatni
Wyniki 21 do 30 z 39

Temat: Main menu - ikona ?

  1. #21
    Wyga
    Dołączył
    02-06-2009
    Skąd
    straszna wiocha
    Wpisy
    3 029
    Punkty
    283

    Domyślny

    fajne drzewo; teraz je przestudiuj

  2. Pani Reklamowa
    Pani Reklamowa jest aktywna
    Avatar Panny Google

    Dołączył
    19-08-2010
    Skąd
    Internet
    Postów
    milion
    Pochwał
    setki
  3. #22
    Bywalec Pavlos awatar
    Dołączył
    01-02-2010
    Wpisy
    125
    Punkty
    10

    Domyślny

    modules.php
    Kod PHP:
    <?php
    defined
    ('_JEXEC') or die('Restricted access'); // no direct access

    if (!defined('_ARTX_FUNCTIONS'))
      require_once 
    dirname(__FILE__) . str_replace('/'DIRECTORY_SEPARATOR'/../functions.php');

    function 
    modChrome_artstyle($module, &$params, &$attribs)
    {
      
    $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle';
      
    $styles = array(
        
    'art-nostyle' => 'modChrome_artnostyle',
        
    'art-block' => 'modChrome_artblock',
        
    'art-article' => 'modChrome_artarticle',
        
    'art-vmenu' => 'modChrome_artvmenu'
      
    );
      
    $sfx $params->get('moduleclass_sfx');
      if (
    in_array($sfxarray_keys($styles)))
        
    $style $sfx;
      
    call_user_func($styles[$style], $module$params$attribs);
    }

    function 
    modChrome_artnostyle($module, &$params, &$attribs)
    {
    if (!empty (
    $module->content)) : ?>
    <div class="art-nostyle">
    <?php if ($module->showtitle != 0) : ?>
    <h3><?php echo $module->title?></h3>
    <?php endif; ?>
    <?php 
    echo $module->content?>
    </div>
    <?php endif;
    }

    function 
    modChrome_artblock($module, &$params, &$attribs)
    {
      if (!empty (
    $module->content))
        echo 
    artxBlock(($module->showtitle != 0) ? $module->title ''$module->content);
    }

    function 
    modChrome_artvmenu($module, &$params, &$attribs)
    {
      if (!empty (
    $module->content)) {
        if (
    function_exists('artxVMenuBlock'))
          echo 
    artxVMenuBlock(($module->showtitle != 0) ? $module->title ''$module->content);
        else
          echo 
    artxBlock(($module->showtitle != 0) ? $module->title ''$module->content);
      }
    }

    function 
    modChrome_artarticle($module, &$params, &$attribs)
    {
      if (!empty (
    $module->content))
        echo 
    artxPost(($module->showtitle != 0) ? $module->title ''$module->content);
    }

    mod_mainmenu
    default.php
    Kod PHP:
    <?php
    defined
    ('_JEXEC') or die('Restricted access'); // no direct access

    ob_start();
    require_once 
    realpath(dirname(__FILE__) . str_replace('/'DIRECTORY_SEPARATOR'/../../../../modules/mod_mainmenu/tmpl/default.php'));
    ob_clean();

    if (!
    defined('modMainMenuArtxExtensions'))
    {

        function 
    modMainMenuArtXMLCallback(&$node$args)
        {
            
    $options $GLOBALS['modMainMenuArtXMLCallbackOptions'];
            if (
    $node->name() == 'li') {
                if (!
    $options['show_submenus'] && $node->level() == 1) {
                    if (
    $ul $node->getElementByPath('ul'))
                        
    $node->removeChild($ul);
                }
                
    $liChildren = & $node->_children;
                if (
    count($liChildren) > 0) {
                    
    // element                 ( $img?,                                          $span ( $text     )  )      )
                    // <a href="...">          <img src="..." (align="left|right")? alt="..." />?<span><![CDATA[...]]></span></a>
                    // <span class="separator"><img src="..." (align="left|right")? alt="..." />?<span><![CDATA[...]]></span></span>
                    
    $element = & $liChildren[0];
                    if (
    $element->_children[0]->name() == 'img') {
                        
    $img = & $element->_children[0];
                        
    $span = & $element->_children[1];
                        
    $element->removeChild($img);
                    } else {
                        
    $img null;
                        
    $span = & $element->_children[0];
                    }
                    
    $element->removeChild($span);
                    
    // convert separator to anchor
                    
    if ($element->name() == 'span' && $element->attributes('class') == 'separator') {
                        
    $element->_name 'a';
                        
    $element->addAttribute('href''#');
                        
    $element->addAttribute('onclick''return false;');
                    }
                    
    // add extra spans for top level items, required for design
                    
    if ($element->level() == ($options['start'] + 1) * 2) {
                        
    $lspan = & $element->addChild('span', array('class' => 'l'));
                        
    $lspan->setData(' ');
                        
    $rspan = & $element->addChild('span', array('class' => 'r'));
                        
    $rspan->setData(' ');
                        
    $tspan = & $element->addChild('span', array('class' => 't'));
                        
    $container = & $tspan;
                    } else {
                        
    $container = & $element;
                    }
                    
    // to prevent span from collapsing
                    
    $text strlen($span->data()) == ' ' $span->data();
                    
    // container is always <a ...>...</a> here
                    
    if ($img != null) {
                        
    $align $img->attributes('align');
                        if (
    $align == 'left' || $align == '') {
                            
    $container->addChild('img', array('class' => 'art-metadata-icon',
                                
    'src' => $img->attributes('src'),
                                
    'style' => 'margin-right: 5px; vertical-align: middle;',
                                
    'alt' => $img->attributes('alt')));
                            
    $extraArtxSpan = & $container->addChild('artx-extra-span');
                            
    $extraArtxSpan->setData($text);
                        } else if (
    $align == 'right') {
                            
    $extraArtxSpan = & $container->addChild('artx-extra-span');
                            
    $extraArtxSpan->setData($text);
                            
    $container->addChild('img', array('class' => 'art-metadata-icon',
                                
    'src' => $img->attributes('src'),
                                
    'style' => 'margin-left: 5px; vertical-align: middle;',
                                
    'alt' => $img->attributes('alt')));
                        }
                    } else {
                        
    $container->setData($text);
                    }
                }

                
    modMainMenuXMLCallback($node$args);

                
    // this should be after modMainMenuXMLCallback, because the callback sets class='active' and id='current'
                
    if ($options['vmenu'] !== null && !$options['vmenu']['simple']) {
                    
    $class $node->attributes('class');
                    
    $isActive $class && false !== strpos(' ' $class' active');
                    if (
    $node->attributes('id') != 'current' && !$isActive) {
                        if (
    $ul $node->getElementByPath('ul'))
                            
    $node->removeChild($ul);
                    }
                }

                
    $class $node->attributes('class');
                if (
    $class && false !== strpos(' ' $class' active')) {
                    
    $element->addAttribute('class''active');
                }
            } else {
                
    modMainMenuXMLCallback($node$args);
            }

        }

        function 
    artxMenuDecorator($content)
        {
            
    $result '';
            
    ob_start();
    ?>
    <div class="art-nav">
        <div class="l"></div>
        <div class="r"></div>
    <?php
            $result 
    .= ob_get_clean() . $content;
            
    ob_start();
    ?>
    </div>
    <?php
            $result 
    .= ob_get_clean();
            return 
    $result;
        }


        
    define('modMainMenuArtxExtensions'true);
    }

    if (isset(
    $attribs['name']) && $attribs['name'] == 'user3') {
        
    $GLOBALS['modMainMenuArtXMLCallbackOptions'] = array(
            
    'show_submenus' => $GLOBALS['artx_settings']['menu']['show_submenus'] && == $params->get('showAllChildren'),
            
    'vmenu' => null,
            
    'start' => $params->get('startLevel')
        );
        
    $xml modMainMenuHelper::getXML($params->get('menutype'), $params'modMainMenuArtXMLCallback');
        if (
    $xml) {
            
    $xml->addAttribute('class''art-menu');
            if (
    $tagId $params->get('tag_id')) {
                
    $xml->addAttribute('id'$tagId);
            }
            
    $result JFilterOutput::ampReplace($xml->toString((bool)$params->get('show_whitespace')));
            
    $result str_replace(array('<ul/>''<ul />''<artx-extra-span>''</artx-extra-span>'), ''$result);
            echo 
    artxMenuDecorator($result);
        }
        unset(
    $GLOBALS['tmp_menu_show_submenus']);
    } else if (
    $params->get('moduleclass_sfx') == 'art-vmenu') {
        
    $GLOBALS['modMainMenuArtXMLCallbackOptions'] = array(
            
    'show_submenus' => $GLOBALS['artx_settings']['vmenu']['show_submenus'] && == $params->get('showAllChildren'),
            
    'vmenu' => array('simple' => $GLOBALS['artx_settings']['vmenu']['simple']),
            
    'start' => $params->get('startLevel')
        );
        
    $xml modMainMenuHelper::getXML($params->get('menutype'), $params'modMainMenuArtXMLCallback');
        if (
    $xml) {
            
    $xml->addAttribute('class''art-vmenu');
            if (
    $tagId $params->get('tag_id')) {
                
    $xml->addAttribute('id'$tagId);
            }
            
    $result JFilterOutput::ampReplace($xml->toString((bool)$params->get('show_whitespace')));
            
    $result str_replace(array('<ul/>''<ul />''<artx-extra-span>''</artx-extra-span>'), ''$result);
            echo 
    $result;
        }
        unset(
    $GLOBALS['tmp_menu_show_submenus']);
    } else {
        
    modMainMenuHelper::render($params'modMainMenuXMLCallback');
    }
    Ok będę szukał dziury Dzięki za pomoc. Nawet nie wiedziałem, że mi ktoś tu tak chętnie będzie pomagał. Pozdrawiam serdecznie.
    Ostanio edytowane przez Pavlos : 19-06-2010 20:39

  4. #23
    Bywalec
    Dołączył
    06-01-2010
    Skąd
    Wrocław
    Wpisy
    143
    Punkty
    31

    Domyślny

    @Pavlos, ten przyrostek _menu-glowne dodajesz chyba w złym miejscu, bo nie ma go w źródle (ctrl+u, a potem ctrl+f i wpisz menu-glowne). A dlaczego nie dodasz przyrostka przez PA? Masz tam w 'Parametry rozszerzone' > Przyrostek klas css modułu.
    ----------------
    Pozdrawiam,
    _eva

  5. #24
    Bywalec Pavlos awatar
    Dołączył
    01-02-2010
    Wpisy
    125
    Punkty
    10

    Domyślny

    Daję przez PA w dokładnie takiej postaci _menu-glowne dlatego nie wiem co jest grane.

  6. #25
    Wyga
    Dołączył
    02-06-2009
    Skąd
    straszna wiocha
    Wpisy
    3 029
    Punkty
    283

    Domyślny

    banał: robicie strony za kasę? niech się autor przyłoży

  7. #26
    Senior zwiastun awatar
    Dołączył
    20-09-2005
    Wpisy
    27 315
    Punkty
    1142

    Domyślny

    Przecieram oczy ze zdumienia, aż mnie bolą. Naprawdę dodanie ikony do pozycji menu jest tak ogromnie trudnym zadaniem? I do czego mają posłużyć tutaj a:
    a) te długaśne cytowane kody
    b) przyrostki klas css menu (modułu).
    Widział kto, jak wygląda pozycja menu z ikoną wstawioną za pomocą ustawień Joomla? Spojrzał który/która, na generowany kod?
    1. W ustawieniach każdej pozycji menu jest parametr: Grafika w menu
    2. W ustawieniach każdego modułu menu jest parametr: Ikony w menu
    A reszta to przysłowiowy pryszcz!
    Korzystaj i ciesz się!
    ===============
    Zwiastun
    Biblioteka Elektronicznej Dokumentacji Joomla!

  8. #27
    Bywalec
    Dołączył
    06-01-2010
    Skąd
    Wrocław
    Wpisy
    143
    Punkty
    31

    Domyślny



    P.S @zwiastun, pavlos chciał do każdego tytułu menu tzn. 'Menu główne', 'Jak zdobyć prawko' , 'Idziemy na egzamin' itd. dodać inną ikonkę zamiast tej gwiazdki. O ile się nie mylę, to to co opisujesz da się chyba zrobić jeśli chce się dodać ikony do poszczególnych odnośników menu, ale nie do samej nazwy modułu.



    Ostanio edytowane przez _eva : 20-06-2010 12:40
    ----------------
    Pozdrawiam,
    _eva

  9. #28
    Wyga
    Dołączył
    02-06-2009
    Skąd
    straszna wiocha
    Wpisy
    3 029
    Punkty
    283

    Domyślny

    Drogi Zwiastunie, nakrzyczałeś na nas niepotrzebnie; @Pavlos nie chce ikon w pozycjach menu, chce wyróżnić "niektóre" h3 modułów, ale jego szablon się opiera standardowym sposobom modyfikacji.

  10. #29
    Senior zwiastun awatar
    Dołączył
    20-09-2005
    Wpisy
    27 315
    Punkty
    1142

    Domyślny

    Nakrzyczałem? Bez przesady! Tak zrozumiałem (nie oglądałem strony, czytałem wątek)
    ja tylko czytam, co czytam, nic więcej:
    Cytat Wysłane przez Pavlos Zobacz wiadomość
    Witam serdecznie. Mam prośbę. Jak wstawić ikonę w Menu dla każdego Menu inna ikona (w pod menu nie mam problemu ze wstawianiem).
    Dzięki za pomoc.
    Cytat Wysłane przez Pavlos Zobacz wiadomość
    Chciałbym wstawić ikonki w lewym menu (Start, Menu główne) zamiast gwiazdek wstawić ikonki.[COLOR="Silver"]
    Ale nawet jeśli rzecz dotyczy tylko obrazka w nagłówku modułu, to również cały ten wątek może zadziwiać.
    Korzystaj i ciesz się!
    ===============
    Zwiastun
    Biblioteka Elektronicznej Dokumentacji Joomla!

  11. #30
    Wyga
    Dołączył
    02-06-2009
    Skąd
    straszna wiocha
    Wpisy
    3 029
    Punkty
    283

    Domyślny

    nic więcej nie dodam - podobno jego szablon się opiera standardowym sposobom modyfikacji;

    pozdrawiam

Strona 3 z 4 PierwszyPierwszy 1234 OstatniOstatni

Podobne tematy

  1. Menedżer menu - nie mogę zmienić nazwy main menu
    przez marens na forum Menu, struktura witryny
    Odpowiedzi: 2
    Ostatni post/autor: 16-02-2010, 12:10
  2. ikona ''new'' w menu
    przez kargulo na forum Różne
    Odpowiedzi: 0
    Ostatni post/autor: 06-06-2008, 00:41
  3. Obrazek/ikona w menu
    przez seba_mal na forum Administracja składnikami
    Odpowiedzi: 0
    Ostatni post/autor: 17-11-2007, 18:16
  4. Pony i ikona w menu
    przez 1MAc na forum PonyGallery
    Odpowiedzi: 0
    Ostatni post/autor: 22-06-2006, 13:44
  5. Main Menu
    przez parys na forum Administracja Joomla!
    Odpowiedzi: 5
    Ostatni post/autor: 05-06-2006, 05:17

Reguły pisania

  • Nie możesz zakładać nowych tematów
  • Nie możesz dodawać wypowiedzi
  • Nie możesz dodawać załączników
  • Nie możesz poprawiać swoich postów
  •