I’m making a plugin for tinyMCE (it will let users build shortcodes to be inserted).
Everything is going well, except that I need my plugin to be able to access Omeka’s functions, so I can do things like list items and collections. I’m basing it on the existing “emotions” plugin, which uses a popup dialog, which in my case is a php file. How do I include all the Omeka stuff, including my theme’s custom.php?
I see from the /index.php page and the /admin/index.php that I can load bootstrap.php and then initialize the application. How do I do this in a “headless” way, so there’s no ui, just available functions?
This shows the home page…
require_once('../../../../../../../../bootstrap.php');
// Configure, initialize, and run the application.
$application = new Omeka_Application(APPLICATION_ENV);
$application->getBootstrap()->setOptions(array(
'resources' => array(
'theme' => array(
'basePath' => THEME_DIR,
'webBasePath' => WEB_THEME
)
)
));
$application->initialize()->run();
This apparently makes it be the “admin” chrome.
define('ADMIN', true);
require_once('../../../../../../../../bootstrap.php');
// Configure, initialize, and run the application.
$application = new Omeka_Application(APPLICATION_ENV);
$application->getBootstrap()->setOptions(array(
'resources' => array(
'theme' => array(
'basePath' => THEME_DIR,
'webBasePath' => WEB_THEME
)
)
));
// Set an admin flag to the front controller.
Zend_Controller_Front::getInstance()->setParam('admin', true);
$application->initialize()->run();