Ignore:
Timestamp:
Oct 21, 2010, 6:15:20 PM (13 years ago)
Author:
grum
Message:

fix some bugs and implement public interface

Location:
extensions/ASearchEngine
Files:
21 added
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/ASearchEngine/ase2.css

    r7196 r7318  
     1/* ---- Generic properties ---- */
     2/* colors are defined in a theme specific CSS file */
     3.ui-dialog-titlebar {
     4  border-bottom:1px solid;
     5  font-size:120%;
     6  font-weight:bold;
     7  margin-bottom:5px;
     8  padding:2px;
     9}
     10.ui-icon-closethick { display: none; }
     11.ui-dialog-buttonpane { padding: 5px; }
     12.ui-dialog-buttonpane button { margin:0px 5px; }
     13.ui-datepicker { border:1px solid; margin-top:-1px; padding:2px; }
     14.ui-datepicker .ui-datepicker-header { margin:-2px; }
     15.ui-datepicker td, .ui-datepicker td:hover { text-decoration:none; margin:2px;
     16  -moz-border-radius:3px;
     17  -webkit-border-radius:3px;
     18  -khtml-border-radius:3px;
     19  border-radius:3px;
     20}
     21.ui-datepicker td.ui-datepicker-current-day { font-weight:bold; }
     22.ui-datepicker td a { border:none; }
     23.ui-datepicker .ui-datepicker-header a { width:auto; }
     24.ui-datepicker .ui-datepicker-header a.ui-datepicker-prev { left:0px; }
     25.ui-datepicker .ui-datepicker-header a.ui-datepicker-next { right:0px; }
     26.ui-datepicker .ui-datepicker-header a span {
     27  left:0;
     28  margin-left:4px;
     29  margin-right:4px;
     30  position:relative;
     31  cursor:pointer;
     32}
    133
     34.ui-category-selector { cursor:default; padding:2px; border:1px solid; }
     35.ui-category-selector-status { margin:3px; padding-left:3px; float:right; font-size:8px; }
     36.ui-category-selector-list {
     37  margin-top:-1px;
     38  cursor:default;
     39  font-size:14px;
     40  font-family:sans-serif;
     41  border:1px solid;
     42}
     43.ui-category-selector-item { min-height:15px; }
     44li.ui-category-selector-item div { margin:2px; }
     45.ui-category-selector-expandable-item,
     46.ui-category-selector-collapsable-item { background: none no-repeat scroll 0px 0px; }
     47.ui-category-selector-check {
     48  position:absolute;
     49  left:0px;
     50  width:15px;
     51  height:15px;
     52  background: none no-repeat scroll 0px 0px;
     53}
     54
     55
     56div#iMenuCriterions ul { margin-top:0px; }
     57.formtable, .formtable P { text-align:justify; display:block; margin-left:0px; }
     58.formtable tr { vertical-align:top; }
     59.pnInactive { cursor:pointer; }
     60.rbResultItemDetail hr { border:none; border-top:1px solid; }
     61
     62
     63/* AMD specific css */
     64#iTagList { list-style-type:none; padding:0px; margin:0px; }
     65span.tagName {
     66  display:inline-block;
     67  margin-right:2px;
     68  padding:2px 0 1px;
     69  width:240px;
     70}
     71#iTagList li { padding: 0px 2px; }
     72#iTagList li:hover { cursor:pointer; }
     73.ruleTypeM, .ruleTypeM2 { display:inline-block; padding:0 2px 0; }
     74div.ruleTypeM { width:493px; }
     75div.ruleTypeM2 { width:400px; }
     76div.ruleSelector { float:left; width:150px; }
     77div.ruleProperties { padding-top:2px; }
     78
     79/* GMaps specific CSS */
     80#iDialogGMapNfo { margin:4px 30px; }
     81
     82
  • extensions/ASearchEngine/ase_pip.class.inc.php

    r7196 r7318  
    1515
    1616include_once('ase_root.class.inc.php');
     17include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCPublicIntegration.class.inc.php');
     18include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php');
     19
    1720
    1821class ASE_PIP extends ASE_root
    1922{
    20 
     23  const SEARCH_SECTION = 'Search';
     24  protected $sectionPage;
    2125  protected $css2;
    2226
     
    2832    $this->initEvents();
    2933    $this->load_lang();
     34
     35    $this->sectionPage=new GPCPublicIntegration(self::SEARCH_SECTION);
     36    $this->sectionPage->setCallbackPageFunction(array(&$this, 'managePage'));
     37    $this->sectionPage->initEvents();
    3038  }
    3139
    3240  public function __destruct()
    3341  {
     42    unset($section_page);
     43
    3444    parent::__destruct();
    3545  }
     
    5262    parent::initEvents();
    5363
    54     add_event_handler('loc_end_page_header', array(&$this->css2, 'applyCSS'));
     64    GPCRequestBuilder::loadJSandCSS();
     65
     66    add_event_handler('init', array(&$this, 'applyJS'));
     67    add_event_handler('loc_begin_page_header', array(&$this->css2, 'applyCSS'), 9); // have to be loaded before other css file (event level from GPCCore=10)
     68    add_event_handler('blockmanager_apply', array(&$this, 'blockmanagerApply'), 55);
    5569  }
    5670
     
    6175  ------------------------------------------------------------------------- */
    6276
     77  public function applyJS()
     78  {
     79    global $template;
     80
     81    GPCCore::addHeaderJS('jquery', 'themes/default/js/jquery.packed.js');
     82
     83    $theme=$template->get_themeconf('name');
     84
     85    $file='plugins/ASearchEngine/themes/'.$theme.'/ASE'.$theme.'.css';
     86    if(($theme=='Sylvia' or
     87        $theme=='clear' or
     88        $theme=='dark') and
     89        file_exists(GPCCore::getPiwigoSystemPath().'/'.$file)) GPCCore::addHeaderCSS('ASE0', $file);
     90
     91    $file='themes/'.$theme.'/css/ASE'.$theme.'.css';
     92    if(file_exists(GPCCore::getPiwigoSystemPath().'/'.$file)) GPCCore::addHeaderCSS('ASE1', $file);
     93
     94    $file='local/css/ASE'.$theme.'.css';
     95    if(file_exists(GPCCore::getPiwigoSystemPath().'/'.$file)) GPCCore::addHeaderCSS('ASE2', $file);
     96  }
     97
     98  public function managePage()
     99  {
     100    global $page, $conf, $template;
     101
     102    /*
     103     * make the title bar
     104     */
     105    $page['title'].=$conf['level_separator'].l10n('ase_search_with_multiple_criteria');
     106    $template->assign('TITLE', $page['title']);
     107
     108    $template->clear_assign(array('U_MODE_CREATED', 'U_MODE_POSTED'));
     109
     110    /*
     111     * display empty template
     112     * (all content are managed with ajax)
     113     */
     114
     115    $template->set_filename('main', dirname(__FILE__)."/templates/search_page.tpl");
     116
     117    $template->assign('ase_search_page', GPCRequestBuilder::displaySearchPage($this->config['ase_publicAccess_allowedPlugins']));
     118
     119    $template->assign_var_from_handle('PLUGIN_INDEX_CONTENT_BEGIN', 'main');
     120  }
     121
     122
     123  /**
     124   * replace the piwigo search.php url by ?/aSearch url
     125   */
     126  public function blockmanagerApply($menu_ref_arr)
     127  {
     128    global $user, $page;
     129    $menu = & $menu_ref_arr[0];
     130
     131    if($this->config['ase_publicAccess_active'])
     132    {
     133      $block=$menu->get_block('mbMenu');
     134      $block->data['search']['URL']=get_root_url().'?/'.self::SEARCH_SECTION;
     135    }
     136  }
    63137
    64138
  • extensions/ASearchEngine/ase_rb_callback.class.inc.php

    r7196 r7318  
    103103  static public function getFilter($param="")
    104104  {
    105     return(self::getWhere($param));
     105    return("");
    106106  }
    107107
  • extensions/ASearchEngine/ase_rb_callback_category.class.inc.php

    r7196 r7318  
    6262    global $user;
    6363
     64    $returned=array();
    6465    if($param['subCat']=='y')
    6566    {
    6667      foreach($param['catIdList'] as $catId)
    6768      {
    68         $returned.=" OR FIND_IN_SET($catId, ase_pct.uppercats) ";
     69        $returned[]=" FIND_IN_SET($catId, ase_pct.uppercats) ";
    6970      }
    7071    }
    7172
    72     return($returned);
     73    return(implode(' OR ', $returned));
    7374  }
    7475
     
    9697  static public function getFilter($param="")
    9798  {
    98     return(self::getWhere($param));
     99    return("");
    99100  }
    100101
  • extensions/ASearchEngine/ase_rb_callback_date.class.inc.php

    r7196 r7318  
    119119  static public function getFilter($param="")
    120120  {
    121     return(self::getWhere($param));
     121    return("");
    122122  }
    123123
  • extensions/ASearchEngine/ase_rb_callback_hd.class.inc.php

    r7196 r7318  
    9999  static public function getFilter($param="")
    100100  {
    101     return(self::getWhere($param));
     101    return("");
    102102  }
    103103
  • extensions/ASearchEngine/ase_rb_callback_keyword.class.inc.php

    r7196 r7318  
    148148  static public function getFilter($param="")
    149149  {
    150     return(self::getWhere($param));
     150    return("");
    151151  }
    152152
  • extensions/ASearchEngine/ase_rb_callback_rate.class.inc.php

    r7196 r7318  
    108108  static public function getFilter($param="")
    109109  {
    110     return(self::getWhere($param));
     110    return("");
    111111  }
    112112
  • extensions/ASearchEngine/ase_root.class.inc.php

    r7207 r7318  
    152152                    dirname(__FILE__).'/templates/ase_dialog_tag_choose.tpl');
    153153
    154       $datas=Array();
    155 
    156       $template->assign('datas', $datas);
    157 
    158154      return($template->parse('ase_tag_choose', true));
    159155    }
     
    171167                    dirname(__FILE__).'/templates/ase_dialog_category_choose.tpl');
    172168
    173       $datas=Array();
    174 
    175       $template->assign('datas', $datas);
    176 
    177169      return($template->parse('ase_category_choose', true));
    178170    }
     
    189181                    dirname(__FILE__).'/templates/ase_dialog_date_choose.tpl');
    190182
    191       $datas=Array();
    192 
    193       $template->assign('datas', $datas);
    194 
    195183      return($template->parse('ase_date_choose', true));
    196184    }
     
    207195                    dirname(__FILE__).'/templates/ase_dialog_keyword_choose.tpl');
    208196
    209       $datas=Array();
    210 
    211       $template->assign('datas', $datas);
     197      $config=array();
     198      GPCCore::loadConfig('ase', $config);
     199      $template->assign('aseConfig', $config);
    212200
    213201      return($template->parse('ase_keyword_choose', true));
     
    225213                    dirname(__FILE__).'/templates/ase_dialog_hd_choose.tpl');
    226214
    227       $datas=Array();
    228 
    229       $template->assign('datas', $datas);
    230 
    231215      return($template->parse('ase_hd_choose', true));
    232216    }
     
    243227                    dirname(__FILE__).'/templates/ase_dialog_rate_choose.tpl');
    244228
    245       $datas=Array();
    246 
    247       $template->assign('datas', $datas);
    248 
    249229      return($template->parse('ase_rate_choose', true));
    250230    }
  • extensions/ASearchEngine/ase_version.inc.php

    r7196 r7318  
    1717  define('ASE_VERSION',  '0.1.0');
    1818  define('ASE_VERSION2', '00.01.00');
    19   define('ASE_GPC_NEEDED', '3.3.1');
     19  define('ASE_GPC_NEEDED', '3.3.2');
    2020?>
  • extensions/ASearchEngine/templates/ase_dialog_category_choose.tpl

    r7196 r7318  
    9090        listMaxWidth:1,
    9191        listMaxHeight:350,
    92         displayStatus:true,
     92        displayStatus:{/literal}{if is_admin()}true{else}false{/if}{literal},
    9393        levelIndent:20,
    94         userMode:'admin',
     94        userMode:{/literal}{if is_admin()}'admin'{else}'public'{/if}{literal},
    9595        galleryRoot:false,
    9696        load: function (event) { $(this).categorySelector('collapse', ':all'); }
Note: See TracChangeset for help on using the changeset viewer.