Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 1 Ответов
  • 4438 Просмотров

Cоздание кнопки поиска с  рисунком. (Как?) Подскажите.

mod_search:

// запрет прямого доступа
defined ( '_VALID_MOS' ) or die ( 'Доступ ограничен' );

$button         = $params->get ( 'button', '' );
$button_pos      = $params->get ( 'button_pos', 'left' );
$button_text   = $params->get ( 'button_text', _SEARCH_TITLE );
$width          = intval ( $params->get ( 'width', 20 ) );
$text          = $params->get ( 'text', _SEARCH_BOX );
$set_Itemid      = intval ( $params->get ( 'set_itemid', 0 ) );

$output = '<input name="searchword" id="mod_search_searchword" maxlength="20" alt="search" class="inputbox'. $moduleclass_sfx .'" type="text" size="'. $width .'" value="'. $text .'"  onblur="if (this.value==\'\') this.value=\''. $text .'\';" onfocus="if (this.value==\''. $text .'\') this.value=\'\';" />';

if ( $button ) {
   $button = '<input type="submit" value="'. $button_text .'" class="button'. $moduleclass_sfx .'"/>';
}

switch ( $button_pos ) {
   case 'top':
      $button = $button .'<br/>';
      $output = $button . $output;
      break;

   case 'bottom':
      $button =  '<br/>'. $button;
      $output = $output . $button;
      break;

   case 'right':
      $output = $output . $button;
      break;

   case 'left':
   default:
      $output = $button . $output;
      break;
}    

// set Itemid id for links
if ( $set_Itemid ) {
   // use param setting
   $_Itemid   = $set_Itemid;
   $link       = 'index.php?option=com_search&amp;Itemid='. $set_Itemid;
} else {
$query = "SELECT id"
. "\n FROM #__menu"
. "\n WHERE link = 'index.php?option=com_search'"
   . "\n AND published = 1"
;
$database->setQuery ( $query );
$rows = $database->loadObjectList ();

   // try to auto detect search component Itemid
if ( count ( $rows ) ) {
   $_Itemid   = $rows[0]->id;
   $link       = 'index.php?option=com_search&amp;Itemid='. $_Itemid;
} else {
   // Assign no Itemid
   $_Itemid    = '';
   $link       = 'index.php?option=com_search';   
   }
}
?>

<form action="<?php echo $link; ?>" method="get">
   <div class="search<?php echo $moduleclass_sfx; ?>">
      <?php echo $output; ?>
   </div>

   <input type="hidden" name="option" value="com_search" />
   <input type="image" src="../images/poick.jpg" value="<?php echo $_Itemid; ?>" />   
</form>

Кому интересно как можна реализовать кнопку (рисунком) в Joomla?
Отвечаю:

Находим строчку которая отвечает за кнопку:

if ( $button ) {
   $button = '<input type="submit" value="'. $button_text .'" class="button'. $moduleclass_sfx .'"/>';

if ( $button ) {
$button = '<input type=image src="poisk.jpg" value="'. $button_text .'" class="buttons'. $moduleclass_sfx .'"/>';

Меняем (input type="submit") на (input type=image src="ваш рисунок") Смотрите правильность пути!

Так как в сss клас (button) означает все кнопки создаем свой (buttons) где меняем цвет фона, рамку, и тд.

Удачи.



Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Мамбот для поиска одинаковых названий и удаления дубликатов

Автор Terys

Ответов: 11
Просмотров: 8582
Последний ответ 10.01.2021, 12:12:30
от Sergeych
Две кнопки, Корзина

Автор Новичек92

Ответов: 1
Просмотров: 1729
Последний ответ 15.04.2013, 10:10:44
от Werber
Как удалить слово из строки поиска

Автор Olegs

Ответов: 11
Просмотров: 13742
Последний ответ 06.08.2012, 08:59:21
от llektor
Социальные закладки в виде дополнительной кнопки рядом с "версией для печати", "pdf" и т.п.

Автор Arina

Ответов: 8
Просмотров: 4635
Последний ответ 28.02.2011, 22:45:36
от Pinin
Не работают кнопки "применить" и "сохранить"

Автор Дмитрий Лебедев

Ответов: 4
Просмотров: 2600
Последний ответ 06.12.2009, 21:26:08
от Yurets