<commit_before><?php
/**
  * @package Module
  * @subpackage Home
  */

/**
  * @package Module
  * @subpackage Home
  */

Kurogo::includePackage('Emergency');

class HomeWebModule extends WebModule {
    protected $id = 'home';
    protected $canBeAddedToHomeScreen = false;
    protected $hideFooterLinks = true;
    
    protected function showLogin() {
        return $this->getOptionalModuleVar('SHOW_LOGIN', true);
    }
    
    private function getTabletModulePanes($tabletConfig) {
        $modulePanes = array();
        
        foreach ($tabletConfig as $blockName => $moduleID) {
            $title = ucfirst($moduleID);
            
            try {
                $module = self::factory($moduleID, 'pane', array());
                
                // Allow module to add javascript and css urls
                $module->fetchPage();
                
                // don't copy inline css and javascript which will be added on  
                // pane content ajax load. See common/templates/pane.tpl
                $cssAndJavascript = $module->exportCSSAndJavascript();
                $cssAndJavascript['properties']['inlineCSSBlocks'] = array();
                $cssAndJavascript['properties']['inlineJavascriptBlocks'] = array();
                $cssAndJavascript['properties']['inlineJavascriptFooterBlocks'] = array();
                $cssAndJavascript['properties']['onOrientationChangeBlocks'] = array();
                $cssAndJavascript['properties']['onLoadBlocks'] = array();
                $this->importCSSAndJavascript($cssAndJavascript);

                $pageData = $module->getPageData();
                if (isset($pageData[$this->page], 
                          $pageData[$this->page]['pageTitle']) && strlen($pageData[$this->page]['pageTitle'])) {
                    
                    $title = $pageData[$this->page]['pageTitle'];
                }
                
            } catch (Exception $e) {
                Kurogo::log(LOG_WARNING, $e->getMessage(), "home", $e->getTrace());
            }
            
            $modulePanes[$blockName] = array(
                'id'        => $moduleID,
                'url'       => self::buildURLForModule($moduleID, 'index'),
                'title'     => $title,
                'elementId' => "content_{$moduleID}",
                'ajaxURL'   => FULL_URL_PREFIX.ltrim($this->buildURL('pane', array('id' => $moduleID)), '/'),
            );
        }
        return $modulePanes;<commit_msg>use the pane page title if it's available<commit_after><?php
/**
  * @package Module
  * @subpackage Home
  */

/**
  * @package Module
  * @subpackage Home
  */

Kurogo::includePackage('Emergency');

class HomeWebModule extends WebModule {
    protected $id = 'home';
    protected $canBeAddedToHomeScreen = false;
    protected $hideFooterLinks = true;
    
    protected function showLogin() {
        return $this->getOptionalModuleVar('SHOW_LOGIN', true);
    }
    
    private function getTabletModulePanes($tabletConfig) {
        $modulePanes = array();
        
        foreach ($tabletConfig as $blockName => $moduleID) {
            $title = ucfirst($moduleID);
            
            try {
                $module = self::factory($moduleID, 'pane', array());
                
                // Allow module to add javascript and css urls
                $module->fetchPage();
                
                // don't copy inline css and javascript which will be added on  
                // pane content ajax load. See common/templates/pane.tpl
                $cssAndJavascript = $module->exportCSSAndJavascript();
                $cssAndJavascript['properties']['inlineCSSBlocks'] = array();
                $cssAndJavascript['properties']['inlineJavascriptBlocks'] = array();
                $cssAndJavascript['properties']['inlineJavascriptFooterBlocks'] = array();
                $cssAndJavascript['properties']['onOrientationChangeBlocks'] = array();
                $cssAndJavascript['properties']['onLoadBlocks'] = array();
                $this->importCSSAndJavascript($cssAndJavascript);

                $pageData = $module->getPageData();
                if (isset($pageData['pane'], 
                          $pageData['pane']['pageTitle']) && strlen($pageData['pane']['pageTitle'])) {
                    
                    $title = $pageData['pane']['pageTitle'];
                } elseif (isset($pageData[$this->page], 
                          $pageData[$this->page]['pageTitle']) && strlen($pageData[$this->page]['pageTitle'])) {
                    
                    $title = $pageData[$this->page]['pageTitle'];
                }
                
            } catch (Exception $e) {
                Kurogo::log(LOG_WARNING, $e->getMessage(), "home", $e->getTrace());
            }
            
            $modulePanes[$blockName] = array(
                'id'        => $moduleID,
                'url'       => self::buildURLForModule($moduleID, 'index'),
                'title'     => $title,
                'elementId' => "content_{$moduleID}",
                'ajaxURL'   => FULL_URL_PREFIX.ltrim($this->buildURL('pane', array('id' => $moduleID)), '/'),
            );
        }
        return $modulePanes;
{'fraction_non_alphanumeric': 0.14095491725318623, 'fraction_numerical': 0.0, 'mean_word_length': 1.8700873362445414, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5033723', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1332, 'n_words': 246}