Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page manipulation API functions #920

Closed
esclkm opened this issue Apr 20, 2012 · 5 comments
Closed

Page manipulation API functions #920

esclkm opened this issue Apr 20, 2012 · 5 comments
Assignees
Labels
Milestone

Comments

@esclkm
Copy link
Member

esclkm commented Apr 20, 2012

add

cot_page_add()
cot_page_edit()
cot_page_delete()

functions

@ghengeveld
Copy link
Contributor

The same is true for many other modules. It would be nice to have CRUD functions in all modules.

@esclkm
Copy link
Member Author

esclkm commented Jun 13, 2012

may be also classes - for easy unddurstanding

@trustmaster
Copy link
Member

Classes are the job for cot-factory, which is an optional bundle.

@ElNinjo
Copy link

ElNinjo commented Jun 14, 2012

GREAT!!! I was dreaming about this... And also, about cot_adduser.
I think there are such stuff in Drupal, but I may be wrong.

@trustmaster
Copy link
Member

The following functions have been implemented:

  • cot_page_auth() - to return auth permissions for a specific page category;
  • cot_page_import() - to import page fields regardless of the caller function or request method;
  • cot_page_validate() - to validate imported page data;
  • cot_page_add() - to save the page in the database and call event handlers;
  • cot_page_delete() - to remove the page from the database and call event handlers;
  • cot_page_update() - to update the page in the database and call event handlers.

Please see PHPDocs for these functions in page.functions.php for more information.

Warning to extension developers: the code of the following hooks has been moved from global scope into local function scope, so you should review your plugins using these hooks and make sure all variables are either declared in the function or declared as global explicitly:

  • page.add.add.query
  • page.add.add.done
  • page.edit.delete.done
  • page.edit.update.done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants