Drupal Theming: Omega drupal .info file? - drupal

I'm using an Omega child theme. I've renamed and renamed all the functions. I'm a bit of a newbie at drupal but a very experienced wordpress user. I'm a bit frustrated by the theme configurations.
I'm trying to use the .info file to override the columns and the layout. Whenever i change the number of columns it doesn't actually render the columns. I've cleared the cache as well. Unfortunately, the settings i've set in the Administration-> Theme -> Theme Configurations Page Override my .info file.
Any ideas?
The following is my .info file for my theme
; $Id: childtheme.info,v 1.1.2.15
; ------- Declare default theme information
name = Child Theme
description = Child Theme built by Globe Runner SEO
screenshot = screenshot.png
core = 6.x
base theme = omega
; ------- Declare default stylesheets
stylesheets[all][] = assets/css/common.css
stylesheets[all][] = assets/css/custom.css
; ------- Declare default javascript includes
scripts[] = assets/js/core.js
; ------- Declare default theme regions
regions[sidebar_first] = sidebar first
regions[sidebar_last] = sidebar last
regions[header_nav] = header nav
;regions[header_last] = header last
regions[preface_first] = preface first
regions[preface_middle] = preface middle
regions[preface_last] = preface last
regions[content_top] = content top
regions[content_bottom] = content bottom
regions[postscript_one] = postscript 1
regions[postscript_two] = postscript 2
regions[postscript_three] = postscript 3
regions[postscript_four] = postscript 4
regions[footer_first] = footer first
regions[footer_last] = footer last
regions[meta_first] = meta first
regions[meta_last] = meta last
; ------- Declare default theme features
features[] = logo
features[] = name
features[] = slogan
features[] = mission
features[] = node_user_picture
features[] = comment_user_picture
features[] = search
features[] = favicon
features[] = primary_links
features[] = secondary_links
; ------- Set the default settings to be used in theme-settings.php
; ------- Non-960gs general settings
settings[reset_css] = 1
settings[text_css] = 1
settings[regions_css] = 1
settings[defaults_css] = 1
settings[custom_css] = 1
settings[front_page_title_display] = title_slogan
settings[page_title_display_custom] = ''
settings[other_page_title_display] = ptitle_stitle
settings[other_page_title_display_custom] = ''
settings[configurable_separator] = ' | '
settings[omega_breadcrumb] = 'yes'
settings[omega_breadcrumb_separator] = ' / '
settings[omega_breadcrumb_home] = 1
settings[omega_breadcrumb_trailing] = 1
settings[omega_breadcrumb_title] = 1
settings[mission_statement_pages] = home
settings[sidebar_combine] = 1
settings[sidebar_contain_pages] = ''
; ------- / Non-960gs general settings
; ------- 960gs default region settings
; ------- default_container_width applies to regions like $help, $messages
settings[omega_default_container_width] = 24
; ------- Region settings for top zone (logo, menus)
settings[omega_branding_wrapper_width] = 24
settings[omega_header_logo_width] = 4
settings[omega_header_menu_width] = 12
; ------- Region settings for header regions
settings[omega_header_wrapper_width] = 24
settings[omega_header_nav_width] = 24
;settings[omega_header_last_width] = 8
; ------- Region settings for default breadcrumb and search box placement
settings[omega_internal_nav_wrapper_width] = 24
settings[omega_breadcrumb_slogan_width] = 10
settings[omega_search_width] = 6
; ------- Region settings for preface regions
;settings[txi_preface_wrapper_grids] = 24
;settings[omega_preface_first_width] = 12
;settings[omega_preface_first_prefix] = 0
;settings[omega_preface_first_suffix] = 0
;settings[omega_preface_middle_width] = 12
;settings[omega_preface_middle_prefix] = 0
;settings[omega_preface_middle_suffix] = 0
;settings[omega_preface_last_width] = 0
;settings[omega_preface_last_prefix] = 0
;settings[omega_preface_last_suffix] = 0
; ------- Region settings for content regions
settings[omega_content_layout] = first_content_last
settings[omega_content_container_width] = 24
settings[omega_sidebar_first_width] = 6
settings[omega_content_main_width] = 17
settings[omega_sidebar_last_width] = 0
; ------- Region settings for postscript regions
settings[omega_postscript_container_width] = 24
settings[omega_postscript_one_width] = 12
settings[omega_postscript_one_prefix] = 0
settings[omega_postscript_one_suffix] = 0
settings[omega_postscript_two_width] = 6
settings[omega_postscript_two_prefix] = 0
settings[omega_postscript_two_suffix] = 0
settings[omega_postscript_three_width] = 4
settings[omega_postscript_three_prefix] = 0
settings[omega_postscript_three_suffix] = 0
settings[omega_postscript_four_width] = 4
settings[omega_postscript_four_prefix] = 0
settings[omega_postscript_four_suffix] = 0
; ------- Region settings for footer regions
settings[omega_footer_container_width] = 24
settings[omega_footer_first_width] = 5
settings[omega_footer_last_width] = 19
; ------- / 960gs default region settings
; Information added by drupal.org packaging script on 2010-07-22
version = "6.x-1.0-beta11"
core = "6.x"
project = "omega"
datestamp = "1279809608"

It's probably because of this code in your theme-settings.php file:
// Get the default values from the .info file.
if (count($subtheme_defaults) > 0) {
// Allow a subtheme to override the default values.
$settings = array_merge($subtheme_defaults, $saved_settings);
}
else {
// Merge the saved variables and their default values.
$defaults = omega_theme_get_default_settings('omega');
$settings = array_merge($defaults, $saved_settings);
}
and the fact that you've saved your settings on the admin/build/themes/settings/omega page.
You'll probably have to delete the relevant settings from the variables table in your database in order for the settings in the .info file to take affect.
I did a little more research into this after posting the above and found the following issue, which offers a better fix for your problem: http://drupal.org/node/795180

Solved. The issue was that you have to reset the default theme values.
This can be accomplished by visiting configuring your own theme:
/admin/build/themes/settings/
Clear the database settings for your theme by clicking "Reset to Defaults"
Thanks #oadaeh !

Related

Typoscript: Override data with typolink

I'm trying to set the canonical url of page. If the individual field (tx_metaseo_canonicalurl) is not set then the url page should be determined by a typolink.
I tried this but it's not working:
30 = TEXT
30 {
data = FIELD:tx_metaseo_canonicalurl
override.typolink = {
parameter.data = TSFE:id
returnLast = url
forceAbsoluteUrl = 1
addQueryString = 1
addQueryString.method = GET
addQueryString.exclude = cHash,backPid
}
override.if.isFalse.field = tx_metaseo_canonicalurl
wrap = <link rel="canonical" href="|" />
required = 1
}
The last 3 lines should be inside the 30 cObj

TYPO3 show content from subpages inlcuding css classes

With the following typoscript I get all content from the subpages on one page:
lib.allPid = COA
lib.allPid {
10 = HMENU
10 {
special = directory
special.value = 2
1 = TMENU
1 {
expAll = 1
NO.doNotShowLink = 1
NO.allStdWrap.field = uid
NO.allStdWrap.wrap = |,
}
2 < .1
}
}
lib.allContent = CONTENT
lib.allContent {
table = tt_content
select {
pidInList.cObject < lib.allPid
leftjoin = pages ON (tt_content.pid = pages.uid)
where = tt_content.colPos = 0
orderBy = pages.sorting ASC
}
}
But its not copying the tt_content wrap defined by the layout selectbox in the content element:
tt_content.stdWrap.innerWrap.cObject.default.20.40 = CASE
tt_content.stdWrap.innerWrap.cObject.default.20.40 {
key.field = layout
1 = TEXT
1.value = tag-1
2 = TEXT
2.value = tag-2
3 = TEXT
3.value = tag-3
4 = TEXT
4.value = tag-4
5 = TEXT
5.value = tag-5
6 = TEXT
6.value = tag-6
7 = TEXT
7.value = tag-7
}
I tried to add the wrap to the lib.allContent element like this, but it didn't work:
lib.allContent.stdWrap.innerWrap.cObject.default.20.40 = CASE
lib.allContent.stdWrap.innerWrap.cObject.default.20.40 {
key.field = layout
1 = TEXT
1.value = tag-1
2 = TEXT
2.value = tag-2
3 = TEXT
3.value = tag-3
4 = TEXT
4.value = tag-4
5 = TEXT
5.value = tag-5
6 = TEXT
6.value = tag-6
7 = TEXT
7.value = tag-7
}
Does anybody know how to do this? Thanks in advance!
EDIT:
I found a solution (or better: workaround) without typoscript. I insert the contents from the subpages with "New content element - Special Elements - Insert Record" manually one by one. Then, everything is copied. This solutions requires a little more user input but fits perfectly to my needs.
give a try to vhs ViewHelper it'll give you exact output what you want I mean default wrap and at all.
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<v:page.menu pageUid="2" includeSpacers="0" resolveExclude="1">
<f:for each="{menu}" as="contentList" iteration="Iteration">
<div id="uid{contentList.uid}" class="inner-page-content-of-pageUid-2">
<v:content.render column="0" pageUid="{contentList.uid}" />
</div>
</f:for>
</v:page.menu>
something more about vhs ViewHelper

After encoding UTF-16, the string is broken if I want to use in iTextSharp

Firstly I am getting some informations from a text file, later these informations are added to pdf files' meta data. In the "Producer" section an error was occured about Turkish characters as ğ, ş. And I solved the problem via using UTF-16 like this:
write.Info.Put(new PdfName("Producer"), new PdfString("Ankara Üniversitesi Hukuk Fakültesi Dergisi (AÜHFD), C.59, S.2, y.2010, s.309-334.", "UTF-16"));
Here is the screenshot:
Then, I am getting all pdf files with foreach loop and reading meta data and insert into SQLite database file. The problem occurs right here. Because when I want to get from pdf file and set to database file UTF-16 encoded string (Producer data), it arises strange characters like this:
I don't understand, why it occurs error.
EDIT: Here is my all codes. The following codes get meta data from text file and insert pdf files' meta meta section:
var articles = Directory.GetFiles(FILE_PATH, "*.pdf");
foreach (var article in articles)
{
var file_name = Path.GetFileName(article);
var read = new PdfReader(article);
var size = read.GetPageSizeWithRotation(1);
var doc = new Document(size);
var write = PdfWriter.GetInstance(doc, new FileStream(TEMP_PATH + file_name, FileMode.Create, FileAccess.Write));
// Article file names like, 1.pdf, 2.pdf, 3.pdf....
// article_meta_data.txt file content like this:
//1#Article 1 Tag Number#Article 1 first - last page number#Article 1 Title#Article 1 Author#Article 1 Subject#Article 1 Keywords
//2#Article 2 Tag Number#Article 2 first - last page number#Article 2 Title#Article 2 Author#Article 2 Subject#Article 2 Keywords
//3#Article 3 Tag Number#Article 3 first - last page number#Article 3 Title#Article 3 Author#Article 3 Subject#Article 3 Keywords
var pdf_file_name = Convert.ToInt32(Path.GetFileNameWithoutExtension(article)) - 1;
var line = File.ReadAllLines(FILE_PATH + #"article_meta_data.txt");
var info = line[pdf_file_name].Split('#');
var producer = Kunye(info); // It returns like: Ankara Üniversitesi Hukuk Fakültesi Dergisi (AÜHFD), C.59, S.2, y.2010, s.309-334.
var keywords = string.IsNullOrEmpty(info[6]) ? "" : info[6];
doc.AddTitle(info[3]);
doc.AddSubject(info[5]);
doc.AddCreator("UzPDF");
doc.AddAuthor(info[4]);
write.Info.Put(new PdfName("Producer"), new PdfString(producer, "UTF-16"));
doc.AddKeywords(keywords);
doc.Open();
var cb = write.DirectContent;
for (var page_number = 1; page_number <= read.NumberOfPages; page_number++)
{
doc.NewPage();
var page = write.GetImportedPage(read, page_number);
cb.AddTemplate(page, 0, 0);
}
doc.Close();
read.Close();
File.Delete(article);
File.Move(TEMP_PATH + file_name, FILE_PATH + file_name);
}
And the following codes get data from files and insert SQLite database file. For database operation, I am using Devart - dotConnect for SQLite.
var files = Directory.GetFiles(FILE_PATH, "*.pdf");
var connection = new Linq2SQLiteDataContext();
TruncateTable(connection);
var i = 1;
foreach (var file in files)
{
var read = new PdfReader(file);
var title = read.Info["Title"].Trim();
var author = read.Info["Author"].Trim();
var producer = read.Info["Producer"].Trim();
var file_name = Path.GetFileName(file)?.Trim();
var subject = read.Info["Subject"].Trim();
var keywords = read.Info["Keywords"].Trim();
var art = new article
{
id = i,
title = (title.Length > 255) ? title.Substring(0, 255) : title,
author = (author.Length > 100) ? author.Substring(0, 100) : author,
producer = (producer.Length > 255) ? producer.Substring(0, 255) : producer,
filename = file_name != null && (file_name.Length > 50) ? file_name.Substring(0, 50) : file_name,
subject = (subject.Length > 50) ? subject.Substring(0, 50) : subject,
keywords = (keywords.Length > 500) ? keywords.Substring(0, 500) : keywords,
createdate = File.GetCreationTime(file),
update = File.GetLastWriteTime(file)
};
connection.articles.InsertOnSubmit(art);
i++;
}
connection.SubmitChanges();
Instead of:
new PdfString(producer, "UTF-16")
Use:
new PdfString(producer, PdfString.TEXT_UNICODE)
UTF-16 is a specific way to store Unicode values but you don't need to worry about that, iText will take care of everything for you.

Problems with TCP in VACaMobil

I am having some problems with TCP in VACaMobil.
I am using two TCP modules built up in Inet: TCPBasicClientApp and TCPEchoApp.
The former works as a client and the former works as a server.
The number of cars (the module name is "coche") in the simulation is 100, and there are five concurrent transmissions:
CLIENT SERVER
Car 0 --> Car 99
Car 1 --> Car 98
Car 2 --> Car 97
Car 3 --> Car 96
Car 4 --> Car 95
I am also using three routing protocols: AODV, DYMO and OLSR.
However, regardless of the configuration that I run, errors like this ocurr in the simulation:
Error in module (TCPBasicClientApp) Highway.coche[*].tcpApp[0] (id = 35) at event #49519, t = 166: IPvXAddressResolver: module 'coche[98]' not found.
In this case, using AODV, the car 1 cannot communicate with the car 98. I learned that VACaMobil, after a time, deletes some cars while it is creating others beyond 100,
such as "coche[110]", "coche[115]", etc.
I don't understand why it keeps deleting and creating nodes; I thought that VACaMobil really generated a constant number of vehicles.
How can I fix this? Any help is appreciated.
Here is the omnetpp.ini:
[General]
network = Highway
debug-on-errors = false
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 10000000s
#repeat = 10
tkenv-plugin-path = ../../../etc/plugins
tkenv-image-path = bitmaps
check-signals = true
**.manager.**.scalar-recording = true
**.manager.**.vector-recording = true
**.manetrouting.**.scalar-recording = true
**.movStats.**.scalar-recording = true
**.movStats.**.vector-recording = true
**.mac.**.scalar-recording = true
**.mac.**.vector-recording = true
**.scalar-recording = true
**.vector-recording = true
#ChannelControl
*.channelControl.carrierFrequency = 2.4GHz
*.channelControl.pMax = 2mW
*.channelControl.sat = -110dBm
*.channelControl.alpha = 2
*.channelControl.numChannels = 1
# TraCIScenarioManagerLaunchd
*.manager.updateInterval = 1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.moduleType = "rcdp9.TAdhocHost"
*.manager.moduleName = "coche"
*.manager.moduleDisplayString = ""
*.manager.autoShutdown = true
*.manager.margin = 25
*.manager.warmUpSeconds = 0
*.manager.launchConfig = xmldoc("VACaMobil/Milan/downtown.launch.xml")
*.manager.getStatistics = true
*.manager.statFiles = "${resultdir}/${configname}-${runnumber}-"
# nic settings
**.wlan[*].bitrate = 24Mbps
**.wlan[*].opMode = "g"
**.wlan[*].mgmt.frameCapacity = 10
**.wlan[*].mgmtType = "Ieee80211MgmtAdhoc"
**.wlan[*].mac.basicBitrate = 24Mbps
**.wlan[*].mac.controlBitrate = 24Mbps
**.wlan[*].mac.address = "auto"
**.wlan[*].mac.maxQueueSize = 14
**.wlan[*].mac.rtsThresholdBytes = 3000B
**.wlan[*].mac.retryLimit = 7
**.wlan[*].mac.cwMinData = 7
**.wlan[*].radio.transmitterPower = 2mW
**.wlan[*].radio.thermalNoise = -110dBm
**.wlan[*].radio.sensitivity = -85dBm
**.wlan[*].radio.pathLossAlpha = 2
**.wlan[*].radio.snirThreshold = 4dB
**.channelNumber = 0
**.coche.networkLayer.configurator.networkConfiguratorModule = "configurator"
# manet routing
**.routingProtocol = ${"AODVUU", "DYMO", "OLSR"}
**.tcpAlgorithmClass = "TCPNewReno"
**.coche[0..4].numTcpApps = 1
**.coche[0..4].tcpApp[*].typename = "TCPBasicClientApp"
**.coche[0..4].tcpApp[*].localPort = -1
**.coche[0..4].tcpApp[*].connectPort = 1000
**.coche[0..4].tcpApp[*].dataTransferMode = "bytecount"
**.coche[0..4].tcpApp[*].startTime = 10s
**.coche[0..4].tcpApp[*].thinkTime = 1s
**.coche[0..4].tcpApp[*].idleInterval = 3s
**.coche[0..4].tcpApp[*].requestLength = 5000000B
**.coche[5..94].numTcpApps = 0
**.coche[95..99].numTcpApps = 1
**.coche[95..99].tcpApp[*].typename = "TCPEchoApp"
**.coche[95..99].tcpApp[*].localPort = 1000
**.coche[95..99].tcpApp[*].dataTransferMode = "bytecount"
**.coche[0].tcpApp[*].connectAddress = "coche[99]"
**.coche[1].tcpApp[*].connectAddress = "coche[98]"
**.coche[2].tcpApp[*].connectAddress = "coche[97]"
**.coche[3].tcpApp[*].connectAddress = "coche[96]"
**.coche[4].tcpApp[*].connectAddress = "coche[95]"
**.meanNumberOfCars = 100
**.autoShutdown = false
Here is TAdhocHost.ned:
package rcdp9;
import inet.networklayer.IManetRouting;
import inet.networklayer.autorouting.ipv4.HostAutoConfigurator2;
import inet.nodes.inet.AdhocHost;
module TAdhocHost extends AdhocHost
{
parameters:
#display("i=device/cellphone");
mobilityType = default("TraCIMobility");
IPForward = true;
submodules:
ac_wlan: HostAutoConfigurator2 {
#display("p=127,240");
}
connections:
}
Here is Highway.ned:
package rcdp9;
import inet.world.VACaMobil.VACaMobil;
import inet.networklayer.autorouting.ipv4.IPv4NetworkConfigurator;
import inet.networklayer.autorouting.ipv4.HostAutoConfigurator;
import inet.nodes.inet.AdhocHost;
import inet.world.radio.ChannelControl;
import inet.world.traci.TraCIScenarioManagerLaunchd;
network Highway
{
submodules:
configurator: IPv4NetworkConfigurator {
#display("p=396,221");
}
channelControl: ChannelControl {
#display("p=396,310");
}
manager: VACaMobil {
#display("p=322,405");
}
connections allowunconnected:
}
From what I understand, VACaMobil is built on Veins.
Veins creates a new network node for every vehicle that starts driving. When the corresponding vehicle stops driving (having arrived at its destination) Veins deletes the network node. It never re-uses the same node index.
Thus, in your example, the first vehicle that starts driving will be coche[0]. The next vehicle that starts driving will be coche[1] - independent of whether coche[0] already arrived or is still driving.

web2py SQLFORM.grid url

When I try to put form = SQLFORM.grid(db.mytable) in my controller the request changes to my/web/site/view?_signature=520af19b1095db04dda2f1b6cbea3a03c3551e13 which causes my if statement in controller to collapse. Can smbd please explain why this happens?
If I put user_signature=False then on view load the grid is shown (though the looks is awful, and I still need to find out how to change the view of my table), but on search,edit, etc. click, the same thing happens again. The url is changed and I get an error
Any suggestions?
thank you
EDIT
This is my edit function
#auth.requires_login()
def edit():
#Load workers
workers = db(db.worker.w_organisation == 10).select(db.worker.w_id_w, db.worker.w_organisation, db.worker.w_first_name, db.worker.w_last_name,db.worker.w_nick_name,db.worker.w_email,db.worker.w_status,db.worker.w_note).as_list()
#Define the query object. Here we are pulling all contacts having date of birth less than 18 Nov 1990
query = ((db.worker.w_organisation == 10) & (db.worker.w_status==db.status.s_id_s))
#Define the fields to show on grid. Note: (you need to specify id field in fields section in 1.99.2
fields = (db.worker.w_first_name, db.worker.w_last_name,db.worker.w_nick_name,db.worker.w_email,db.status.s_code,db.worker.w_note)
#Define headers as tuples/dictionaries
headers = { 'worker.w_first_name' : 'Ime',
'worker.w_last_name' : 'Priimek',
'worker.w_nick_name' : 'Vzdevek',
'worker.w_email' : 'E-posta',
'status.s_code': 'Status',
'worker.w_note' : 'Komentar' }
#Let's specify a default sort order on date_of_birth column in grid
default_sort_order=[db.worker.w_last_name]
#Creating the grid object
form = SQLFORM.grid(query=query, fields=fields, headers=headers,searchable=True, orderby=default_sort_order,create=True, \
deletable=True, editable=True, maxtextlength=64, paginate=25,user_signature=False
)
form = SQLFORM.grid(db.worker,user_signature=False)
workersDb = db((db.worker.w_organisation == 10) & (db.worker.w_status==db.status.s_id_s)).select(db.worker.w_id_w, \
db.worker.w_organisation, db.worker.w_first_name, \
db.worker.w_last_name,db.worker.w_nick_name,db.worker.w_email,\
db.status.s_code,db.worker.w_note).as_list()
workersList = []
for rec in workersDb:
status = rec['status']['s_code']
workers = rec['worker']
if not rec["worker"]["w_first_name"]:
polno_ime = rec["worker"]["w_last_name"]
elif not rec["worker"]["w_last_name"]:
polno_ime = rec["worker"]["w_first_name"]
else:
polno_ime = rec["worker"]["w_first_name"] + " " + rec["worker"]["w_last_name"]
rec["worker"]['w_full_name'] = polno_ime
rec["worker"]["w_status"] = status
data = rec["worker"]
#print rec
#print data
workersList.append(rec["worker"])
# If type of arg is int, we know that user wants to edit a script with an id of the argument
if(request.args[0].isdigit()):
script = db(getDbScript(request.args[0])).select(db.script.sc_lls, db.script.sc_name, db.script.id, db.script.sc_menu_data).first()
formData = str(script["sc_menu_data"])
#form = SQLFORM.grid(db.auth_user)
#print formData
# If we dont get any results that means that user is not giving proper request and we show him error
#print script
#Parsing script to be inserted into view
if not script:
return error(0)
return dict(newScript = False, script = script, formData = formData, workers = workersList, form = form)
# If the argument is new we prepare page for new script
elif request.args[0] == 'new':
scripts = db((auth.user.organization == db.script.sc_organization)).select(db.script.sc_name, db.script.id, workers = workersList, form = form)
return dict(newScript = True, scripts = scripts, workers = workersList, form = form)
# Else error
else:
return error(0)
also not to mention the sqlgrid looks awful, here is link to the picture https://plus.google.com/103827646559093653557/posts/Bci4PCG4BQQ

Resources