【发布时间】:2011-12-21 08:32:12
【问题描述】:
我一直在尝试将 css 应用于我的 Drupal 页面,但我没有反映这些更改。 以下是我的页面(仪表板页面)http://www.image-share.com/ijpg-1145-262.html 的截图。我的目标是格式化表格列表以显示 10 行 一个时间,以便表格可以滚动以查看所有行(而不是它现在如何分布在整个页面上)。 下面给出的是代码。
function freeway_dashboard(){
drupal_add_css(drupal_get_path('module', 'freeway_module') .'/css/dashboard_file.css');
//echo(drupal_get_path('module', 'freeway_module') .'/css/dashboard_file.css');
drupal_add_js(drupal_get_path('module', 'freeway_module') .'/js/dashboardscript.js');
$listOfProjectsIds = array();
$listOfProjectsDesc = array();
$node = node_load(arg(1));
$form = array();
$arrayStatus = array(1 =>'Draft',2=>'NotSpecified',3=>'Quote',4=>'Forecasted',5=>'InEvaluation',6=>'Cancelled',7=>'Booked',8=>'InProduction',9=>'Completed',10=>'Closed');
$LoginClient = new SoapClient("https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?wsdl", array("trace"=>1));
$ServicesLink = new SoapClient("https://freeway.demo.lionbridge.com/vojo/Service.asmx?wsdl", array("trace"=>1));
try{
$arrResponse = $LoginClient->Logon(array ('Username'=>'user','Password'=>'Password'));
$ticket = ($arrResponse->LogonResult);
$getSrcLang = $ServicesLink->GetSourceLanguages(array('Ticket'=>$ticket));
$getDraftProjectIds = $ServicesLink->GetProjectSummariesList(array('Ticket'=>$ticket,'NumberOfProjects'=>100,'SortOrder'=>MostRecent,'ProjectStatusCode'=>'Draft'));
foreach ($getDraftProjectIds->GetProjectSummariesListResult->ProjectSummaries->ProjectSummary as $i=>$getDraftProjectIds->GetProjectSummariesListResult->ProjectSummaries->ProjectSummary)
{
$listOfProjectsIds[$i] = $getDraftProjectIds->GetProjectSummariesListResult->ProjectSummaries->ProjectSummary->ID;
$listOfProjectsDesc[$i] = $getDraftProjectIds->GetProjectSummariesListResult->ProjectSummaries->ProjectSummary->Description;
}
}
catch (SoapFault $exception){
return $exception;
}
$form['status_list']=array(
'#type'=>'select',
'#title' => t('Freeway Project Statuses'),
'#options' => $arrayStatus,
'#default_value' => ('Draft'),
'#attributes'=> array('onselect' => "populateStatusTables();"),
'#weight'=>3,
);
$header = array('Project ID', 'Project Description');
$rows = array();
for($m=0;$m <count($listOfProjectsIds);$m+=1){
$rows[$m] = array($listOfProjectsIds[$m], $listOfProjectsDesc[$m]) ;
}
$form['table'] = array(
'#value' => theme('table', $header, $rows, array( 'class' => 'table_class','id'=>'dashboard_Table')),
//'#value' => '<div class="table_class_wrapper">'. theme('table', $header, $rows, array('class' => 'table_class','id'=>'dashboard_Table')) .'</div>',
'#weight' => 4,
);
return $form;
}
我已经在 $form['table'] 元素的值中给出了 css 类提及的代码。 我尝试使用 css 包含:
drupal_add_css(drupal_get_path('module', 'freeway_module') .'/css/dashboard_file.css');
css 文件位于“C:\xampp\htdocs\drupalTheme\sites\all\modules\freeway_module\css”。 下面是css文件中的代码。
.table_class {
height: 200px;
overflow: auto;
}
但我仍然认为代码无法访问 css 文件。我是否包含正确的文件?期待您的建议。
谢谢 安吉拉。
【问题讨论】:
标签: php css drupal-6 drupal-theming