Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetSimple 3.1 Beta Cut r506 (July 1, 2011)
#35
n00dles101 Wrote:Hi Johannes,

I've been trying to convert my customfields plugin the last couple of days and I'm also running into the same problem.

Leave it with me, I should have something sorted by this evening....

Mike....

Good day.

I have played with a another way to allow multi plugins to add there fields without overwriting others data.

Looks maybe like alot of code or bulky, but it can get the job done. can mabe get a more generic functions for scenarios like this.

Code:
// Plugin Authors should add custome fields etc.. here
            $customArr['data'] = &$data;
            $customArr['customdata'] = array();
              $customArr = exec_filter('caching-save',$customArr);
            if (count($customArr['customdata']) > 0) {
              foreach ($customArr['customdata'] as $addItems) {
                foreach($addItems as $addKey => $addItem) {
                  $note = $pages->addChild($addKey );
                  $note->addCData($addItem);        
                  $pagesArray[(string)$id][$addKey ]=(string)$addItem;
                }  
              }
            }

to set it in plugin then we can just do it like this

Code:
$data['customdata'][] = array('domain'=>(string)$data['data']->domain);

Seems to work without any problems. and I can send my values and it gets saved.

Hope it can help find a solution, just thought I'd share.
tx
Johannes
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply


Messages In This Thread
GetSimple 3.1 Beta Cut r506 (July 1, 2011) - by dominionit - 2011-07-18, 05:28:57



Users browsing this thread: 1 Guest(s)