CustomFields - want to enhance
jerryh
Joined: 2013-02-04
Posts: 27 |
![]() |
Module: CustomFields I want to prefix this comment by I am new to Gallery2 and looking for additional information. I am working on Gallery2 and want to enhance its features to add custom fields to items Any additional information on this module would be helpful. Thanks SYSTEM INFO PHP INFO Remove this FAQ information from your post before submitting. - Please add '[module / theme name]' along with specific subject in the title of your topic
|
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
You would need to create a CustomfieldOnUploadOption.inc to extend ItemAddOption lastly you would need to registerFactoryImplementation for this in customfield/module.inc eg: $ret = GalleryCoreApi::registerFactoryImplementation('ItemAddOption', 'CustomfieldOnUploadOption', 'CustomfieldOnUploadOption', 'modules/customfield/CustomfieldOnUploadOption.inc', 'customfield', null); if ($ret) { return $ret; }
-s |
|
jerryh
Joined: 2013-02-04
Posts: 27 |
![]() |
Thank you. This is helpfule.. I will take a look. I am looking at CustomField still at lower levels (Database) just to see whats going on. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Interacting with the table directly would not be the gallery way of doing things. Looking at CustomFieldItemEdit.inc should give you enough info to know how to react in handleRequestAfterAdd -s |
|
jerryh
Joined: 2013-02-04
Posts: 27 |
![]() |
Correct. I am trying to learn whats going on with the system. Thanks... |
|
jerryh
Joined: 2013-02-04
Posts: 27 |
![]() |
So Another similar question.... We will be doing batch uploads of photos/albums. for creating new albums programmitcally, where do you suggest the best place to look? ItemAddAlbum.inc |
|
jerryh
Joined: 2013-02-04
Posts: 27 |
![]() |
loadTemplate is for UI - if we need one |
|
jerryh
Joined: 2013-02-04
Posts: 27 |
![]() |
I meant function isAppropriate($item, $thumbnail) { |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Quote:
isAppropriate -- Just return "true"? Did you make onUpload an option in admin? if so is the option set to true? function isAppropriate() { list($ret, $onUpload) = GalleryCoreApi::getPluginParameter('module', 'customfield', 'onUpload'); if ($ret) { return array($ret, false); } return array(null, $onUpload > 0); } if not, just return array(null, true); -s |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
isAppropriate receives no parameters -s |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
This may help http://codex.galleryproject.org/Gallery2:ItemAdd -s |
|