18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
43 'target_assetid' => Array(
47 'description' =>
'DEPRECATED - DONE WITH LINKS INSTEAD FROM V0.2',
49 'element_id' => Array(
52 'default' =>
'js_calendar_navigator',
53 'description' =>
'Element ID on HTML page',
55 'style_assetid' => Array(
59 'description' =>
'Optional CSS',
76 if (!parent::_upgrade($current_version))
return FALSE;
77 $am =& $GLOBALS[
'SQ_SYSTEM']->am;
78 if (version_compare($current_version,
'0.2',
'<')) {
79 pre_echo(
'UPGRADING CALENDAR NAVIGATOR DESIGN AREA TO V0.2');
80 $instances = $am->getTypeAssetids($this->
getAssetType(), FALSE, TRUE);
81 $to_reparse = Array();
82 foreach ($instances as $id => $type) {
83 $instance = $am->getAsset($id,
'design_area_js_calendar_navigator');
84 $pageid = @$instance->attr(
'target_assetid');
85 if (!empty($pageid)) {
86 $page = $am->getAsset($pageid);
87 if (!is_null($page)) {
88 foreach (Array(
'day',
'week',
'month',
'year') as $view) {
89 $instance->createLink($page, SQ_LINK_NOTICE, $view.
'_page');
93 $designs = $instance->getDesigns();
94 foreach (array_keys($designs) as $i) {
95 if ($designs[$i]->type() ==
'design') {
97 $to_reparse[] = $designs[$i]->id;
101 pre_echo(
'REPARSING DESIGNS');
103 foreach (array_unique($to_reparse) as $designid) {
104 $design = $am->getAsset($designid,
'design');
105 if (is_null($edit_fns)) {
106 $edit_fns = $design->getEditFns();
108 $edit_fns->parseAndProcessFile($design);
109 $design->_updateCustomisations();
111 pre_echo(
'CALENDAR NAVIGATOR DESIGN AREA COMPLETE');