Уведомления

Группа в Telegram: @pythonsu

#1 Июнь 14, 2015 11:43:19

mikhail19999
Зарегистрирован: 2015-06-14
Сообщения: 1
Репутация: +  0  -
Профиль   Отправить e-mail  

Срочно. Нужна помощь по ZOPE2. Заплачу.

Ситуация такая. Есть локальная система тестирования (писал не я), написанная на Zope2. Нужна помочь с описанием кода (пояснениями) некоторых файлов данной системы. Кто может, помогите!! Сам ноль в этом. Нужно очень срочно. Код в документе.


drawAuth Script (Python) at  /drawAuth

if _.SecurityGetUser().has_role('Authenticated'):
return ‘<a href=“/manage_zmi_logout”>%s</a>’ % container.images.pic_logout.tag(border='0')

return ‘'


drawBack
Script (Python) at  /drawBack


tps = {
’Folder': ‘/images/pic_home’,
‘Institute Folder’: ‘/images/pic_kie’,
}

s = ‘<a class=“submenu” href=“%s”><img border=“0” src=“%s” /></a>’

request = context.REQUEST

if not context.getId():
if request.get('URL0') != request.get('BASE0')+'/index_html':
return s % ('/', ‘/images/pic_home’)
else:
if context.meta_type in :
parent = context.aq_parent.aq_parent
else:
parent = context.aq_parent
if parent.getId():
return s % (parent.absolute_url(), tps.get(parent.meta_type,'/images/pic_home'))
else:
return s % ('/', ‘/images/pic_home’)


return ‘'

drawGradi Script (Python) at  /drawGradi

print ’<div id=“gradi”><table border=“0” cellpadding=“0” cellspacing=“0”><tr>'
if href:
tag = ‘<td style=“padding-right: 10”><a href=“’+href+'”>%s</a></td>'
else:
tag = ‘<td style=“padding-right: 10”>%s</td>’
if img:
print tag % img.tag(border='0')
if txt:
print tag % txt
print ‘</tr></table></div>’
return printed



getPIPKA Script (Python) at  /getPIPKA

pip = context.REQUEST.get('PIPKA')
if pip:
return pip

imgs = context.images
pips = {
‘Folder’: imgs.pip_home,
‘Institute Folder’: imgs.pip_kie,
‘Test Group’: imgs.pip_people,
‘Test Student’: imgs.pip_person,
‘Question Folder’: imgs.pic_edit,
‘Test’: imgs.pic_test,
‘Question 1’: imgs.pic_question,
‘Question 2’: imgs.pic_question,
‘Question 3’: imgs.pic_question,
‘Question 4’: imgs.pic_question,
‘Question 5’: imgs.pic_question,
}

return pips.get(context.meta_type, ‘&nbsp;’)



gui_html_header DTML Method at  /gui_html_header

<html>
<dtml-call “RESPONSE.setHeader('Cache-Control','no-cache')”>
<head>
<title>Тест</title>
<dtml-unless management_page_charset>
<dtml-call “REQUEST.set('management_page_charset','UTF-8')”>
</dtml-unless>
<meta http-equiv=“content-type” content=“text/html;charset=&dtml-management_page_charset;”>
<dtml-call “RESPONSE.setHeader('content-type','text/html;charset='+management_page_charset)”>
<meta name=“Generator” content=“ZOPE”>
<link rel=“stylesheet” href=“<dtml-var ”gui_css.absolute_url()“>” type=“text/css”>
</head>
<body bgcolor=“#0e5300”>

<table height=100% width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr><td align=“center” valign=“middle”>
<table width=“80%” cellspacing=“10”>

gui_html_header.old DTML Method at  /gui_html_header.old


<html>
<dtml-call “RESPONSE.setHeader('Cache-Control','no-cache')”>
<head>
<title>Тест</title>
<dtml-unless management_page_charset>
<dtml-call “REQUEST.set('management_page_charset','UTF-8')”>
</dtml-unless>
<meta http-equiv=“content-type” content=“text/html;charset=&dtml-management_page_charset;”>
<dtml-call “RESPONSE.setHeader('content-type','text/html;charset='+management_page_charset)”>
<meta name=“Generator” content=“ZOPE”>
<link rel=“stylesheet” href=“<dtml-var ”gui_css.absolute_url()“>” type=“text/css”>
</head>
<body bgcolor=#0e5300>

<table height=100% width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr><td align=“center” valign=“middle”>
<table width=“80%” height=“80%” cellspacing=“10”>
<tr>
<td id=“page-header”><table height=“100” width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr><td align=“left” valign=“middle”><h2 style=“font-size: 30; padding: 0; margin: 0;”>ИЭ</h2></td>
<td align=“right” valign=“bottom”><dtml-var drawBack><dtml-var “REQUEST.get('PIPKA','&nbsp;')”></td></tr>
</table></td>
</tr>
<tr>
<td id=“page-title”><table width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr><td align=“left” valign=“bottom”><h2 style=“padding: 0; margin: 0;”><dtml-var “REQUEST.get('PAGEHEADER',title_or_id())”></h2></td>
<td align=“right” valign=“bottom”><dtml-var drawBack></td></tr>
</table></td>
</tr>

<tr><td style=“padding: 10 30”>

gui_main_menu DTML Method at  /gui_main_menu

<html>
<dtml-call “RESPONSE.setHeader('Cache-Control','no-cache')”>
<head>
<title>Тест</title>
<dtml-unless management_page_charset>
<dtml-call “REQUEST.set('management_page_charset','UTF-8')”>
</dtml-unless>
<meta http-equiv=“content-type” content=“text/html;charset=&dtml-management_page_charset;”>
<dtml-call “RESPONSE.setHeader('content-type','text/html;charset='+management_page_charset)”>
<meta name=“Generator” content=“ZOPE”>
<link rel=“stylesheet” href=“<dtml-var ”style_css.absolute_url()“>” type=“text/css”>
</head>
<body bgcolor=#00ff00>
<table height=100% width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr><td align=“center” valign=“middle”>
<table width=“80%” height=“80%” cellspacing=“10”><tr><td bgcolor=“#ffffff” style=“padding: 10”>
<font color=#2d2d2d size=+2>институт </font><br clear=all>
<dtml-if “REQUEST.has_key('page_sub_header')”>
<div align=“right”><dtml-var page_sub_header></div>
</dtml-if>
</td></tr>
<tr><td bgcolor=“#ffffff”>

<dtml-var “images.btn_home.tag()”>
<a href=“/manage_zmi_logout”><dtml-var “images.btn_logout.tag(border='0')”></a>

Отредактировано mikhail19999 (Июнь 14, 2015 12:39:46)

Прикреплённый файлы:
attachment часть 1 кода.odt (38,0 KБ)

Офлайн

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version