Napi patch: Nodereferrer create Organic Groups kompatibilitás

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Kategória: 
patch

A Nodereferrer Create egy okos kis modul, ami annyit csinál, hogyha van egy node, amiben egy node_reference mezőben már meglévő tartalomra tudunk hivatkozni, akkor miért is ne lehetne ugyanarról a node-ról azokat a tartalmakat létrehozni?

Lássuk konkrétan a feladatot:

Van egy tartalomtípusom, project. Ehhez node_reference-szel hozzá tudok adni password_record nevű tartalomtípusokat. Eddig semmi gond, a nodereferrer_create modul kipakolja a szükséges linkeket a project node-hoz, amit azon keresztül adok hozzá, az egyből be is lesz kapcsolva a project node-ba.

Nálam bonyolította a helyzetet, hogy organic_groups-t is használok. Vagyis szeretném, ha az így bekapcsolt password_record node-ok egyből abba a csoportba kerüljenek, amelybe maga a project van.
Ezt azonban nem kezeli a modul.

Ilyen linket ad alapból: node/%/create_reference/0/password_record
És nekünk ez kell: node/%/create_reference/0/password_record?gids[]=%

Nézzük akkor a forráskódot, illetve nem másolom be az egészet, van még egy pár feltétel, amit megvizsgál, de az alapelv ugyanaz.

[geshifilter-drupal6]** /** * hook_nodeapi view for reference fields * * Add the forms/fields */ function _nodereferrer_create_nodeapi_view_reference(&$node, $teaser, $page) { $menu_items = array(); foreach($node->reference_fields as $i => $ref) { $multiple = $ref['multiple'] == 1; $items = array(); foreach (array_filter($ref['referenceable_types']) as $referenceable_type) { $type_info = content_types($referenceable_type); if ($multiple) { if (node_access('create', $referenceable_type)) { $text = t(variable_get('nodereferrer_create_reference_label', 'Create new @type'), array('@type' => $type_info['name'])); $url = 'node/'.$node->nid.'/create_reference/'.$i.'/'.$referenceable_type; // és most jön a lényeg: ez a sor állítja elő a linket, amivel a kapcsolódó tartalmat létrehozhatjuk: $items[] = l($text, $url); } } // Add to main menu $menu_items[] = array('title' => $ref['field']['widget']['label'], 'items' => $items); return $menu_items; }[/geshifilter-drupal6]

$items[] = l($text, $url); - ugye ez standard Drupal linkgyáros, már csak arra kell rávenni, hogy azt a queryt utána tegye, ami csoportba fogja helyezni az új node-ot.

Ehhez ennyi kell:

[geshifilter-drupal6] $url = 'node/'.$node->nid.'/create_reference/'.$i.'/'.$referenceable_type; //innen jön a saját kód. Először megvizsgáljuk, hogy az organic_groups modul létezik-e. if (module_exists('og')) { // ha ok, akkor kérdezzük meg, hogy van-e jelenleg csoportkontextus, vagyis a project node, amin vagyunk, csoportba van-e beküldve $group = og_get_group_context(); //akkor most kérdezzük meg, hogy az a tartalomtípus, amit létre akarunk hozni, egyáltalán csoportba beküldhető tartalom-e if ($group && og_is_group_post_type($referenceable_type)) { //ha igen, akkor használjuk az l függvény opciójaként megadható query-t, amit szépen egy ? után biggyeszt majd a link végére. $options = array ( 'query' => 'gids[]=' . $group->nid , ) ; } } $items[] = l($text, $url, $options); [/geshifilter-drupal6]

Ez csak egyetlen dolgot nem kezel, a nodereferrer_create ugyanis tesz még a node-ra egy fület is. Nekem nincs erre szükségem, mivel saját modulból legyalultam, de akinek van kedve, egy csokiért/sörért/kortypálinkáért a Drupal hétvégén bekommentelhetné, hogy hook_menu_alterben hogyan pattinthatnánk a link mögé queryt. Akár ide is: http://drupal.org/node/949858 :)

Ps. kéretik nem hatalmasak kacagni az angol botladozásaimon, már untam minden issuemhoz odaírni, hogy sorry for my english.

Hozzászólások

Hi my friend! I want to say

Hi my friend! I want to say that this article is amazing, great written and come with approximately all significant infos. I would like to peer extra posts like this .|

I really love your blog..

I really love your blog.. Very nice colors & theme. Did you build this website yourself? Please reply back as I'm wanting to create my own site and would love to learn where you got this from or exactly what the theme is named. Kudos!|

A lot of phonics textbooks

A lot of phonics textbooks implement well-known personas out of much-loved kids' shows or even publication range to inspire checking out.

In many instances, you will

In many instances, you will have to wake up to convert properly, which often makes you have got to sleep once more.

Stress some suitcase during

Stress some suitcase during the using request: Heavy outfits have to be affreux towards the bottom of your condition while using the facade looking at max.

Taxi moto line 128 Rue la

Taxi moto line
128 Rue la Boétie
75008 Paris
+33 6 51 612 712  

Taxi moto paris

I do accept as true with all the concepts you have introduced on your post.

They're very convincing and can certainly work.
Nonetheless, the posts are too quick for starters.
May just you please prolong them a little from next time?
Thank you for the post.

RecommendationsThe July 2004

RecommendationsThe July 2004 "Dietary Tips designed for Americans" offers always keeping saturated fat usage below Ten % with the each day kilocalories although {American|United states|U .

M.E.C Mon Electricien

M.E.C Mon Electricien Catalan
44 Rue Henry de Turenne
66100 Perpignan
0651212596

Electricien Perpignan

Thanks for finally talking about >Válasz a hozzászólásra

effectiveness will most

effectiveness will most likely his particular muscular strength, therefore he / she will be seeking many other issues that potentially he or she uneasy by way of.

This Wizard for OzThroughout

This Wizard for OzThroughout all of the dvd we viewed Dorothy search to have the varied magician which means this lady might get back home.

It's an remarkable article in

It's an remarkable article in favor of all the web users; they will get benefit from it I am sure.|

It's really a great and

It's really a great and useful piece of information. I'm satisfied that you just shared this helpful info with us.
Please keep us informed like this. Thank you for sharing.

Hello There. I found your

Hello There. I found your blog using msn. That is a very well
written article. I will be sure to bookmark it and return to learn more of
your useful info. Thanks for the post. I will certainly comeback.

Great post. I was checking

Great post. I was checking constantly this blog and I am impressed!

Extremely helpful info specifically the last part :) I care for such information much.

I was looking for this certain info for a long time. Thank you and good luck.

I'm curious to find out what

I'm curious to find out what blog system you're utilizing?
I'm having some minor security problems with my latest blog and I'd like to
find something more safe. Do you have any solutions?

Touche. Sound arguments. Keep

Touche. Sound arguments. Keep up the amazing effort.

Undeniably consider that that

Undeniably consider that that you stated. Your favorite justification seemed to be on the net the simplest factor
to take into account of. I say to you, I certainly get
annoyed even as other folks consider concerns that they just don't recognise about.
You managed to hit the nail upon the highest and
also defined out the whole thing with no need side-effects
, other people could take a signal. Will likely be back to get
more. Thank you

The other day, while I was at

The other day, while I was at work, my cousin stole my
iPad and tested to see if it can survive a twenty five foot drop,
just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83 views.
I know this is totally off topic but I had to share it with someone!

Sweet blog! I found it while

Sweet blog! I found it while searching on Yahoo News. Do you have any tips on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!
Cheers

I don't know if it's just me

I don't know if it's just me or if everybody else experiencing issues
with your site. It appears like some of the written text in your posts are
running off the screen. Can somebody else please provide
feedback and let me know if this is happening to them
as well? This could be a problem with my web browser because I've had this happen before.
Cheers
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

We're a bunch of volunteers

We're a bunch of volunteers and opening a brand new scheme in our community.
Your site offered us with useful information to work on. You have performed a
formidable task and our entire community can be thankful to you.

Wonderful goods from you,

Wonderful goods from you, man. I have understand your stuff
previous to and you are just extremely magnificent. I really like what you've acquired here, certainly like what
you're saying and the way in which you say it. You make it enjoyable and you still take care
of to keep it sensible. I can't wait to read much
more from you. This is really a wonderful web site.

Wow, fantastic weblog format!

Wow, fantastic weblog format! How lengthy have you ever been blogging for?

you made blogging look easy. The overall glance of your site is wonderful, as smartly as
the content material!

I like the helpful info you

I like the helpful info you provide for your
articles. I will bookmark your blog and test
again right here frequently. I am slightly sure I'll learn plenty
of new stuff proper here! Good luck for the following!

fantastic submit, very

fantastic submit, very informative. I wonder why the opposite experts of this sector do not notice this.

You should continue your writing. I am confident,
you've a great readers' base already!

Nice post. I learn something

Nice post. I learn something new and challenging on sites I stumbleupon everyday.
It's always helpful to read through articles
from other authors and practice something from their sites.

Have you ever thought about

Have you ever thought about adding a little bit more than just your articles?
I mean, what you say is important and everything.
Nevertheless think about if you added some great visuals
or videos to give your posts more, "pop"! Your content is excellent but with images
and videos, this blog could certainly be one of
the greatest in its niche. Terrific blog!
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Hey! I know this is kinda off

Hey! I know this is kinda off topic but I was wondering which blog platform
are you using for this website? I'm getting fed up of Wordpress because I've had issues with hackers and I'm looking at alternatives for another platform.
I would be great if you could point me in the direction of a good platform.

I'm extremely impressed

I'm extremely impressed together with your writing skills and also with the structure to your blog.
Is that this a paid theme or did you modify it your self?
Anyway stay up the nice high quality writing, it's rare to peer
a nice blog like this one nowadays..

Great article, exactly what I

Great article, exactly what I wanted to find.

That is very interesting,

That is very interesting, You're an overly skilled blogger.

I've joined your feed and stay up for looking for extra of your excellent post.
Additionally, I have shared your site in my social networks

I used to be recommended this

I used to be recommended this website by way of my cousin. I am now not positive
whether this post is written by way of him as no one else recognize such distinct
about my difficulty. You're wonderful! Thank you!

This website was... how do

This website was... how do you say it? Relevant!!

Finally I've found something that helped me. Kudos!

When some one searches for

When some one searches for his essential thing, so he/she
needs to be available that in detail, so that thing is maintained over here.

Now it is time to pick your

Now it is time to pick your specific investments.

Willie G youllied For hottest

Willie G youllied

For hottest news you have to pay a quick visit world-wide-web
and on internet I found this web page as a most excellent website for most
recent updates.

Howdy would you mind letting

Howdy would you mind letting me know which hosting company you're using?
I've loaded your blog in 3 different browsers and I must say this blog loads a lot faster then most.
Can you suggest a good hosting provider at a fair
price? Kudos, I appreciate it!

FlexBuild Huntington Beach Concrete Company
2520 Florida St, Huntington Beach, CA 92648
714-410-5374
suzannaweiss98719 [at] gmail [dot] com

Asking questions are

Asking questions are genuinely fastidious thing if you are not understanding anything entirely, but
this article offers nice understanding yet.

FlexBuild Huntington Beach Concrete Company
2520 Florida St, Huntington Beach, CA 92648
714-410-5374
suzannaweiss98719 [at] gmail [dot] com

Independance Immobilière -

Independance Immobilière - Agence Dakar Sénégal
Av. Fadiga, Immeuble Lahad Mbacké
BP 2975 Dakar
+221 33 823 39 30

Agence Immobilière Dakar

Very nice post. I just stumbled upon your blog and wanted to say that I have really
enjoyed browsing your blog posts. In any case I will be subscribing to your feed and I hope you write again soon!

What's up to every , for the

What's up to every , for the reason that I am actually keen of reading this website's post to be
updated daily. It consists of pleasant information.

Thank you for sharing your

Thank you for sharing your info. I really
appreciate your efforts and I am waiting for your next
post thanks once again.

If some one needs to be

If some one needs to be updated with most up-to-date technologies therefore he
must be go to see this website and be up to date daily.

Hi there! I know this is

Hi there! I know this is somewhat off topic but I was wondering which blog platform are you
using for this site? I'm getting fed up of Wordpress because
I've had problems with hackers and I'm looking at options for another platform.

I would be awesome if you could point me in the direction of a good
platform.

Wow that was strange. I just

Wow that was strange. I just wrote an extremely long comment but after I clicked submit my comment didn't
show up. Grrrr... well I'm not writing all that over again.
Regardless, just wanted to say wonderful blog!

Very rapidly this site will

Very rapidly this site will be famous amid all blogging and site-building viewers, due to it's pleasant content

Fantastic items from you,

Fantastic items from you, man. I've be mindful your stuff prior to and
you are simply extremely great. I really like what you have acquired here, really like what you are stating and the way
in which you say it. You make it entertaining and you still care for to stay it
sensible. I cant wait to learn much more from you. This is actually a tremendous web site.

Hello everyone, it's my first

Hello everyone, it's my first go to see at this web page,
and article is truly fruitful designed for me, keep up posting such
content.

Great blog you've got here..

Great blog you've got here.. It's difficult to find
high-quality writing like yours nowadays. I truly
appreciate people like you! Take care!!

I loved as much as you will

I loved as much as you will receive carried out right
here. The sketch is tasteful, your authored material stylish.
nonetheless, you command get got an shakiness over that you wish be delivering the following.
unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this increase.

Howdy! Do you know if they

Howdy! Do you know if they make any plugins to
assist with SEO? I'm trying to get my blog to rank for some targeted
keywords but I'm not seeing very good results. If you know of any
please share. Thank you!

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.