mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-22 18:35:35 +08:00
61 lines
1.8 KiB
PHP
61 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* Copyright 2012-2026 ShopeX (https://www.shopex.cn)
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
|
|
class desktop_application_widgets extends desktop_application_prototype_xml{
|
|
|
|
var $xml='desktop.xml';
|
|
var $xsd='desktop_content';
|
|
var $path = 'widgets';
|
|
|
|
function controller(){
|
|
return $this->app->controller($this->key);
|
|
}
|
|
|
|
function current(){
|
|
$this->current = $this->iterator()->current();
|
|
$this->key = $this->current['id'];
|
|
return $this;
|
|
}
|
|
|
|
function row($fag,$key){
|
|
$row = array(
|
|
'menu_type' => $this->content_typename(),
|
|
'app_id'=>$this->target_app->app_id,
|
|
'menu_order'=>$this->current['order'],
|
|
);
|
|
$row['menu_title'] = $this->current['value'];
|
|
$row['addon'] = $this->current['id'];
|
|
return $row;
|
|
}
|
|
|
|
function install(){
|
|
kernel::log('Installing '.$this->content_typename().' '.$this->key());
|
|
$menus_row = $this->row($fag,$key);
|
|
return app::get('desktop')->model('menus')->insert($menus_row);
|
|
}
|
|
|
|
function clear_by_app($app_id){
|
|
if(!$app_id){
|
|
return false;
|
|
}
|
|
app::get('desktop')->model('menus')->delete(array(
|
|
'app_id'=>$app_id,'menu_type' => $this->content_typename()));
|
|
}
|
|
|
|
}
|