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

Dynamic object to embed arbitrary HTML into pages #43

Closed
jbroadway opened this issue Oct 7, 2011 · 0 comments
Closed

Dynamic object to embed arbitrary HTML into pages #43

jbroadway opened this issue Oct 7, 2011 · 0 comments
Milestone

Comments

@jbroadway
Copy link
Owner

Need a dynamic object handler that shows a textarea to paste HTML, but converts it to a key and stores the HTML elsewhere so the tag doesn't become:

{! admin/html?content=<strong>some+text</strong> !}

As you can see, that would get ugly fast. Need a callback setting for replacing the input in dynamic objects, for example the callback could simply do:

<?php

function my_dynamic_object_callback ($data) {
    // store the data
    db_execute ('insert into dynamic_objects (id, data) values (null, ?)', $data);

    // return the id of it
    return db_lastid ();
}

?>

Then the handler rendering the dynamic object would be able to say:

<?php

$html = db_shift ('select data from dynamic_objects where id = ?', $data['id']);

?>

An API for this would be simple to create.

jbroadway pushed a commit that referenced this issue May 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant