コード例 #1
0
 function getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules)
 {
     $aEvent = $this->_oDb->getEvents(array('browse' => 'last', 'owner_id' => $this->_oModule->_iOwnerId, 'filter' => $sFilter, 'modules' => $aModules));
     if (empty($aEvents) || !is_array($aEvents)) {
         return "";
     }
     $iMaxDuration = (int) $aEvent['ago_days'] + 1;
     if (empty($sTimeline)) {
         $sTimeline = '0' . BX_WALL_DIVIDER_TIMELINE . $iMaxDuration;
     }
     $aInput = array('type' => 'doublerange', 'name' => 'timeline', 'value' => $sTimeline, 'attrs' => array('min' => 0, 'max' => $iMaxDuration, 'onchange' => $this->_oConfig->getJsObject('view') . ".changeTimeline(e)"));
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array());
     $sContent = $oForm->genInput($aInput);
     $sContent = $oForm->genWrapperInput($aInput, $sContent);
     return $this->parseHtmlByName('timeline.html', array('content' => $sContent));
 }
コード例 #2
0
ファイル: BxBaseGrid.php プロジェクト: Baloo7super/dolphin
 protected function _getCellSwitcher($mixedValue, $sKey, $aField, $aRow)
 {
     $sAttr = $this->_convertAttrs($aField, 'attr_cell', 'bx-def-padding-sec-bottom bx-def-padding-sec-top', isset($aField['width']) ? 'width:' . $aField['width'] : false);
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array(), $this->_oTemplate);
     $oForm->addCssJs();
     $aInput = array('type' => 'switcher', 'name' => $this->_sObject . '_switch_' . $aRow[$this->_aOptions['field_id']], 'caption' => '', 'attrs' => array('bx_grid_action_single' => 'enable', 'bx_grid_action_confirm' => '', 'bx_grid_action_data' => $aRow[$this->_aOptions['field_id']]), 'value' => $aRow[$this->_aOptions['field_id']], 'checked' => $this->_isSwitcherOn(isset($aRow[$this->_aOptions['field_active']]) ? $aRow[$this->_aOptions['field_active']] : false, $sKey, $aField, $aRow));
     $sSwitcher = $oForm->genInput($aInput);
     return '<td ' . $sAttr . '>' . $sSwitcher . '</td>';
 }