szt képe

Na megnéztem: az van, hogy a fenti függvény az email mezőbe nem tud beleszólni, erre egy másikat kell beizzítani: theme_webform_email

Innentől már sima ügy, az alábbi kód kell a template.php-ba:

  1. function SMINKEDNEVE_webform_email($variables) {
  2. $element = $variables['element'];
  3.  
  4. // This IF statement is mostly in place to allow our tests to set type="text"
  5. // because SimpleTest does not support type="email".
  6. if (!isset($element['#attributes']['type'])) {
  7. $element['#attributes']['type'] = 'email';
  8. }
  9.  
  10. // Convert properties to attributes on the element if set.
  11. foreach (array('id', 'name', 'value', 'size') as $property) {
  12. if (isset($element['#' . $property]) && $element['#' . $property] !== '') {
  13. $element['#attributes'][$property] = $element['#' . $property];
  14. }
  15. }
  16.  
  17. $element['#attributes']['placeholder'] = '[email protected]';
  18.  
  19. _form_set_class($element, array('form-text', 'form-email'));
  20.  
  21. return '<input' . drupal_attributes($element['#attributes']) . ' />';
  22. }

Az eredetihez képest a 17. sor lett beszúrva.

Ebben a folyamatban a megfelelő függvény megtalálása a legnehezebb, ebben segíthet a Devel modulhoz kapcsolódó Theme developer, az API reference, és contrib moduloknál a DrupalContrib API reference. Ja és a Form API Reference :)

5
0
hosszu.kalman képe

Jaja, csak ezzel az a gond, hogy a links-be nem csak a tovább link van. Ahhoz már a preprocess_node fgv-t kéne használni.

Valami ilyesmi így hírtelen:

<?php
function phptemplate_preprocess_node(&$vars) {
  if ($vars['type'] == 'a tipus') {
    unset($vars['node']->links['a tovabb gomb neve']);
    $vars['links'] = theme('links', $vars['node']->links);
  }
}
?>
0
0
Phoere képe

Jobb híjján belenéztem az SQL adatbázisba és a block táblában belekerült mindkét blokk. Viszont a 'region' érték üres maradt a '-1' helyett (a ami a tiltottnak felel meg).

Tehát módosítottam az block_info függvényeket így, és ekkor már jó lett:

  1. function custom_module_block_info() {
  2. $blocks = array();
  3. $blocks['custom-module-datum-id'] = array(
  4. 'info' => t('Date in head'),
  5. 'status' => 1,
  6. 'region' => '-1'
  7. );
  8.  
  9. $blocks['custom-module-welcome-id'] = array(
  10. 'info' => t('Welcome in head'),
  11. 'status' => 1,
  12. 'region' => '-1'
  13. );
  14. return $blocks;
  15. }
0
0

Csökönyi Ferenc

dyra képe

Ezt már néztem, az a gond, hogy az összes domain megy az újra. Jelen pillanat így nézek ki.

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  Order allow,deny
</FilesMatch>
 
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
 
# Follow symbolic links in this directory.
Options +FollowSymLinks
 
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
 
# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  # There is no end quote below, for compatibility with Apache 1.3.
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
 
# Set the default handler.
DirectoryIndex index.php
 
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
 
# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>
 
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>
 
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>
 
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On
 
  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600
 
  <FilesMatch \.php$>
    # Do not allow PHP scripts to be cached unless they explicitly send cache
    # headers themselves. Otherwise all scripts would have to overwrite the
    # headers set by mod_expires if they want another caching behavior. This may
    # fail if an error occurs early in the bootstrap process, and it may cause
    # problems if a non-Drupal PHP file is installed in a subdirectory.
    ExpiresActive Off
  </FilesMatch>
</IfModule>
 
# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
 
  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
 
  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /
 
    ### BOOST START ###
  AddDefaultCharset utf-8
  <FilesMatch "(\.html|\.html\.gz)$">
    <IfModule mod_headers.c>
      Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
      Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
    </IfModule>
  </FilesMatch>
  <IfModule mod_mime.c>
    AddCharset utf-8 .html
    AddCharset utf-8 .css
    AddCharset utf-8 .js
    AddEncoding gzip .gz
  </IfModule>
  <FilesMatch "(\.html|\.html\.gz)$">
    ForceType text/html
  </FilesMatch>
  <FilesMatch "(\.js|\.js\.gz)$">
    ForceType text/javascript
  </FilesMatch>
  <FilesMatch "(\.css|\.css\.gz)$">
    ForceType text/css
  </FilesMatch>
 
  # Gzip Cookie Test
  RewriteRule boost-gzip-cookie-test\.html  cache/perm/boost-gzip-cookie-test\.html\.gz [L,T=text/html]
 
  # GZIP - Cached css & js files
  RewriteCond %{HTTP_COOKIE} !(boost-gzip)
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=2]
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz -s
  RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz [L,QSA,T=text/css]
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz -s
  RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz [L,QSA,T=text/javascript]
 
  # NORMAL - Cached css & js files
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css -s
  RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js -s
  RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]
 
  # Caching for anonymous users
  # Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
  RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
  RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
  RewriteCond %{HTTP:Pragma} no-cache [OR]
  RewriteCond %{HTTP:Cache-Control} no-cache [OR]
  RewriteCond %{HTTPS} on
  RewriteRule .* - [S=3]
 
  # GZIP
  RewriteCond %{HTTP_COOKIE} !(boost-gzip)
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=1]
  RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
  RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html]
 
  # NORMAL
  RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
  RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
 
  ### BOOST END ###
 
  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
 
# $Id$
 
# non empty HTTP_HOST in the request
        RewriteCond %{HTTP_HOST} !^$ [NC]
# the hostname does start with 'www.'
        RewriteCond %{HTTP_HOST} ^www\. [NC]
# let's extract the hostname without 'www.' and save it to %1
        RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# let's redirect to the extracted hostname, $1 saves the URL
        RewriteRule ^(.*)$ "http://%1/$1" [L,R=301]

Ide kellene +1 sor ami csak és kizárólag egy domaint irányít át a többit meg itt hagyja. Ja és közben az eddigi beállításaim is "életben" maradnak.

0
0

honlapom http://dyra.eu/

realdream képe

Erre van kész megoldás az apiban: http://api.drupal.org/api/function/taxonomy_form/6

A taxonomy_form automatikusan létrehozza a form elemet.

taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy')

pl:

$form['language'] = taxonomy_form(2, $value = 0, $help = null, $name = 'taxonomy'); 
$form['send'] = array('#type' => 'submit', '#value' => t('Keresés'));
return $form;

De amit írtál azt elvileg a views-el is egyszerűen megoldhatod: Filter->Expose.

0
0

-------------------------------
http://www.realdream.hu

norbiii képe

Ha az alábbi rövid modulból szeretnék kiindulni akkor mit kellene modosítsak rajta, mert hasonló megoldást valósít meg mint amit én szeretnék csak a a kommentre vonatkozóan. Nekem meg pont a node törzsére vagy egy cck mezőjére kellene megvalósítanom.

<?php
function comment_action_mail_mail_alter(&$message) {
  if ($message['id'] == 'system_action_send_email') {
    if (isset($message['params']['context']['comment'])) {
      $comment = $message['params']['context']['comment'];
      $tr = array(
        '%comment_subject' => drupal_html_to_text($comment->subject),
        '%comment_body' => drupal_html_to_text(check_markup($comment->comment, $comment->filter)),
        '%comment_username' => drupal_html_to_text($comment->name),
        '%comment_delete_url' => url('comment/delete/'.$comment->cid, array('absolute'=>TRUE)),
        '%comment_edit_url' => url('comment/edit/'.$comment->cid, array('absolute'=>TRUE)),
      );
      foreach ($message['body'] as $key => $val) {
        $message['body'][$key] = strtr($val, $tr);
      }
    }
  }
}

Próbáltam, hogy ha módosítom és a comment helyett node-ot írok, de nem jöttem rá hogyan és miként kell használni.

Nem tudok rájönni, hogy némelyik mezőket miért nem jeleníti meg és amelyiket pedig megjeleníti (field_mezőneve). De viszont formázás az nem úgy történik meg mint ahogyan én azt megszerkesztettem.
Norbi

0
0
csakiistvan képe

nem nyúltam bele az eredeti kódba, ami ez:

<?php
function YOURTHEMESNAME_select($element) {
  $select = '';
  if (in_array($element['#post']['form_id'], 'views_exposed_form')) {
    $element['#attributes'] = array('class' => 'jquery_dropdown jquery_dropdown_jump');
  }
  $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : '';
  _form_set_class($element, array('form-select'));
  $multiple = $element['#multiple'];
  return theme('form_element', $element, '<select name="'. $element['#name'] .''. ($multiple ? '[]' : '') .'"'. ($multiple ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="'. $element['#id'] .'" '. $size .'>'. form_select_options($element) .'</select>');
}
?>
0
0

Drupal full-stack developer at Wunderman Thompson Budapest

Voluman képe

Nem az adatbázisban van letárolva, a commerce.currency.inc fájlban vannak a pénznemek adatai. Felülírni a hook_commerce_currency_info_alter() függvényből lehet, valahogy így:

  1. function modulodneve_commerce_currency_info_alter() {
  2. return array (
  3. 'HUF' => array(
  4. 'code' => 'HUF',
  5. 'symbol' => 'Ft',
  6. 'name' => t('Magyar Forint'),
  7. 'numeric_code' => '348',
  8. 'thousands_separator' => ' ', // ezres elválasztó
  9. 'decimal_separator' => ',', // tizedes elválasztó
  10. 'decimals' => 0, // tizedesjegyek száma
  11. 'symbol_placement' => 'after',
  12. 'code_placement' => '',
  13. 'major_unit' => t('Forint'),
  14. ),
  15. );
  16. }
2
0
Robert Petras képe

Ahogy a fent belinkent filmen látjátok sikerült összehoznom a Drush Make build fájl futtatásával egy Drupal telepítő profilban újabb Make fájl futtatását.

Bosszantott azonban a dolog, hogy nem tudtam jól artikuláltan megfogalmazni, hogy mi volt a gondom és hol akadtam el. Addig keresgéltem hát, amíg találtam egy jó leírást erre a folyamatra.

A jól érthető választ a Drush telepítése/letöltése során létrehozott dokumentációs mappában találtam meg. A ./drush/docs/make.txt eredetileg markdown fájlnak készült doksi oldalon van egy rész, amely leírja a rekurziós folyamatot.

Bemásolom ide ezt a rész, hátha egyszer valaki megtalálja az oldalt hasonló kérdésre keresve a választ.

RECURSION

If a project that is part of a build contains a .make itself, drush make will automatically parse it and recurse into a derivative build.

For example, a full build tree may look something like this:

  1. drush make distro.make distro
  2.  
  3. distro.make FOUND
  4.  
  5. - Drupal core
  6. - Foo bar install profile
  7. + foobar.make FOUND
  8. - CCK
  9. - Token
  10. - Module x
  11. + x.make FOUND
  12. - External library x.js
  13. - Views
  14. - etc.

Recursion can be used to nest an install profile build in a Drupal site, easily build multiple install profiles on the same site, fetch library dependencies for a given module, or bundle a set of module and its dependencies together.

For Drush Make to recognize a makefile embedded within a project, the makefile itself must have the same name as the project.

For instance, the makefile embedded within the managingnews profile must be called "managingnews.make". The file should also be in the project's root directory. Subdirectories will be ignored.

Build a full Drupal site with the Managing News install profile:

  1. core = 6.x
  2. projects[] = drupal
  3. projects[] = managingnews
2
0
vacati képe

Annyi látok benne józan parasztival, hogy ott van a Posted szó és a dátum formátum. Ezt átírni nem szeretném, mert az nem lenne elegáns megoldás. Azt szeretném, ha ez a smink jól viselkedne és a beállításokat átvenné.

Na de itt a php:

<div class="<?php print $classes; ?>">
  <div class="node-inner clear-block">
    <?php if (!$page): ?>
      <h1 class="title"><a href="<?php print $node_url; ?>" title="<?php print $title ?>"><?php print $title; ?></a></h1>
    <?php endif; ?>
    <?php if ($unpublished): ?>
      <div class="unpublished"><?php print t('Unpublished'); ?></div>
    <?php endif; ?>
    <?php if ($submitted): ?>
	  <span class="submitted">Posted on <?php echo date("d. M, Y", $created).t(' by ').$name; ?></span>
    <?php endif; ?>
    <?php if ($terms): ?>
      <span class="terms"><?php print t(' in ') . $node_terms; ?></span>
    <?php endif; ?>
    <div class="content clear-block">
      <?php print $content; ?>
    </div>
    <?php if ((!$page)||($links)): ?>
      <div class="extra-links">
        <?php print $links; ?>
      </div>
	<?php endif; ?>
  </div>
</div> <!-- /node-inner, /node -->
0
0